aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Libzot.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2022-10-23 14:02:19 +0200
committerMario Vavti <mario@mariovavti.com>2022-10-23 14:02:19 +0200
commit8879776d6436ed5257648a1873ddaa9486b25070 (patch)
tree996c192607ed8b1a4b03bd620deb4b1f3b348a48 /Zotlabs/Lib/Libzot.php
parent5edd13c6bb89c7434d8437f8cc74c038371fdbf8 (diff)
downloadvolse-hubzilla-8879776d6436ed5257648a1873ddaa9486b25070.tar.gz
volse-hubzilla-8879776d6436ed5257648a1873ddaa9486b25070.tar.bz2
volse-hubzilla-8879776d6436ed5257648a1873ddaa9486b25070.zip
fix php warnings
Diffstat (limited to 'Zotlabs/Lib/Libzot.php')
-rw-r--r--Zotlabs/Lib/Libzot.php14
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