diff --git a/database.mwb b/database.mwb index 136c143..bbc23a3 100644 Binary files a/database.mwb and b/database.mwb differ diff --git a/database.mwb.bak b/database.mwb.bak index 6eab250..90f9d3b 100644 Binary files a/database.mwb.bak and b/database.mwb.bak differ diff --git a/endpoints/notary.fetchkey.php b/endpoints/notary.fetchkey.php index 41dff6c..5d5b9f2 100644 --- a/endpoints/notary.fetchkey.php +++ b/endpoints/notary.fetchkey.php @@ -25,12 +25,12 @@ $out = []; foreach ($results as $r) { $out[] = [ "fingerprint" => $r["fingerprint"], - "name" => $r["name"], - "email" => $r["email"], - "location" => $r["location"], + "name" => empty($r["name"]) ? null : $r["name"], + "email" => empty($r["email"]) ? null : $r["email"], + "location" => empty($r["location"]) ? null : $r["location"], "commissionexpires" => (is_null($r["commissionexpires"]) ? null : strtotime($r["commissionexpires"])), - "idnumber" => $r["idnumber"], - "state" => $r["state"], + "idnumber" => empty($r["idnumber"]) ? null : $r["idnumber"], + "state" => empty($r["state"]) ? null : $r["state"], "publickey" => $r["publickey"] ]; } diff --git a/endpoints/notary.publishkey.php b/endpoints/notary.publishkey.php index b10aad7..ec142e9 100644 --- a/endpoints/notary.publishkey.php +++ b/endpoints/notary.publishkey.php @@ -11,7 +11,7 @@ $pubkey = $VARS["publickey"]; $name = $VARS["name"] ?? null; $email = filter_var($VARS["email"] ?? "", FILTER_VALIDATE_EMAIL) ? $VARS["email"] : null; $location = $VARS["location"] ?? null; -$commissionexpires = (strtotime($VARS["expires"]) === false || strtotime($VARS["expires"]) <= time()) ? null : date("Y-m-d H:i:s", strtotime($VARS["expires"])); +$commissionexpires = (empty($VARS["expires"]) || strtotime($VARS["expires"]) === false || strtotime($VARS["expires"]) <= time()) ? null : date("Y-m-d H:i:s", strtotime($VARS["expires"])); $idnumber = $VARS["idnumber"] ?? null; $state = $VARS["state"] ?? null;