aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-06-16 12:27:08 +0000
committerMario <mario@mariovavti.com>2023-06-16 12:27:08 +0000
commit84487edc05a28f016872058ca3175fdf41efbcb6 (patch)
tree4e3a48bf27ba9e5b11a4cd60fabd05aab5cf4097
parent7177649969825033a0e5ef3cf024e68c21e6acc9 (diff)
downloadvolse-hubzilla-84487edc05a28f016872058ca3175fdf41efbcb6.tar.gz
volse-hubzilla-84487edc05a28f016872058ca3175fdf41efbcb6.tar.bz2
volse-hubzilla-84487edc05a28f016872058ca3175fdf41efbcb6.zip
undefined variable and return null in fetch_local if we did not find anything (we also return null in fetch)
-rw-r--r--Zotlabs/Lib/Activity.php2
-rw-r--r--Zotlabs/Lib/ActivityStreams.php4
2 files changed, 5 insertions, 1 deletions
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;
}