From 8879776d6436ed5257648a1873ddaa9486b25070 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 23 Oct 2022 14:02:19 +0200 Subject: fix php warnings --- Zotlabs/Lib/Libzot.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Lib/Libzot.php') 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 -- cgit v1.2.3