From 84487edc05a28f016872058ca3175fdf41efbcb6 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 16 Jun 2023 12:27:08 +0000 Subject: undefined variable and return null in fetch_local if we did not find anything (we also return null in fetch) --- Zotlabs/Lib/Activity.php | 2 +- Zotlabs/Lib/ActivityStreams.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 23ba89462..9a28b7038 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -66,7 +66,7 @@ class Activity { if ($items) { return self::encode_item(array_shift($items), true); } - return false; + return null; } static function fetch($url, $channel = null) { diff --git a/Zotlabs/Lib/ActivityStreams.php b/Zotlabs/Lib/ActivityStreams.php index 1f10ac027..8b8c95ad8 100644 --- a/Zotlabs/Lib/ActivityStreams.php +++ b/Zotlabs/Lib/ActivityStreams.php @@ -306,10 +306,13 @@ class ActivityStreams { */ function fetch_property($url, $channel = null) { + $x = null; + if (str_starts_with($url, z_root() . '/item/')) { $x = Activity::fetch_local($url, $this->portable_id ?? ''); logger('local: ' . print_r($x,true)); } + if (!$x) { $x = Activity::fetch($url, $channel); if ($x === null && strpos($url, '/channel/')) { @@ -320,6 +323,7 @@ class ActivityStreams { $x = Activity::fetch($url, $channel); } } + return $x; } -- cgit v1.2.3