diff options
Diffstat (limited to 'Zotlabs/Lib/Libzot.php')
-rw-r--r-- | Zotlabs/Lib/Libzot.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index c86eb29cd..6e8a5d5bc 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -589,8 +589,6 @@ class Libzot { */ static function register_hub($id) { - $hsig_valid = false; - $result = ['success' => false]; if (!$id) { @@ -599,8 +597,14 @@ class Libzot { $record = Zotfinger::exec($id); + if (!$record) { + return $result; + } + // Check the HTTP signature + $hsig_valid = false; + $hsig = $record['signature']; if ($hsig['signer'] === $id && $hsig['header_valid'] === true && $hsig['content_valid'] === true) { $hsig_valid = true; @@ -641,6 +645,12 @@ class Libzot { */ static function import_xchan($arr, $ud_flags = UPDATE_FLAGS_UPDATED, $ud_arr = null) { + + if (!is_array($arr)) { + logger('Not an array: ' . print_r($arr, true), LOGGER_DEBUG); + return $ret; + } + /** * @hooks import_xchan * Called when processing the result of zot_finger() to store the result |