From 10d1cbd3ce58fb868a42d1425f62f908df395e7d Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 14 May 2024 09:00:43 +0000 Subject: php warnings/errors --- Zotlabs/Lib/Activity.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Zotlabs/Lib/Activity.php') diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 75d2ffbe9..b819ef0f7 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -1727,9 +1727,12 @@ class Activity { foreach ($links as $link) { if (is_array($link) && array_key_exists('mediaType', $link) && $link['mediaType'] === 'text/html') { $profile = $link['href']; + } elseif (is_string($link)) { + $profile = $link; + break; } } - if (!$profile) { + if (!$profile && isset($links[0]['href'])) { $profile = $links[0]['href']; } } -- cgit v1.2.3 From a4d63ab9a35a3e3c5e128e266e5ddc3c2c6d2e8e Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 4 Jun 2024 09:05:34 +0000 Subject: hotfix to mitigate queueworker crash --- Zotlabs/Lib/Activity.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Lib/Activity.php') diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index b819ef0f7..b628221fb 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -762,7 +762,12 @@ class Activity { $ptr = [$ptr]; } foreach ($ptr as $att) { + if (!is_array($att)) { + continue; + } + $entry = []; + if (array_key_exists('href', $att) && $att['href']) { $entry['href'] = $att['href']; } elseif (array_key_exists('url', $att) && $att['url']) { @@ -1085,12 +1090,16 @@ class Activity { static function encode_person($p, $extended = true) { + $ret = (($extended) ? [] : ''); + + if (!is_array($p)) { + return $ret; + } + $c = ((array_key_exists('channel_id', $p)) ? $p : channelx_by_hash($p['xchan_hash'])); $id = (($c) ? channel_url($c) : ((filter_var($p['xchan_hash'], FILTER_VALIDATE_URL)) ? $p['xchan_hash'] : $p['xchan_url'])); - $ret = (($extended) ? [] : ''); - if (!$id) { return $ret; } -- cgit v1.2.3 From 388e7c88dff956dca9e3498076e9f3cf49a153c8 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 10 Jun 2024 08:22:43 +0000 Subject: remove superfluous param, fix wrong var and declare types for unparse_url() --- Zotlabs/Lib/Activity.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Lib/Activity.php') diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index b628221fb..5613e6bda 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -70,7 +70,7 @@ class Activity { } if ($items) { - return self::encode_item(array_shift($items), true); + return self::encode_item(array_shift($items)); } return null; @@ -2902,7 +2902,7 @@ class Activity { if (intval($parent[0]['item_private'])) { if (!intval($item['item_private'])) { - $item['item_private'] = intval($parent_item['item_private']); + $item['item_private'] = intval($parent[0]['item_private']); $item['allow_cid'] = '<' . $channel['channel_hash'] . '>'; $item['allow_gid'] = $item['deny_cid'] = $item['deny_gid'] = ''; } -- cgit v1.2.3 From 4ba4b2976e71d3ba61148962eab35bedf50d140a Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 11 Jun 2024 07:42:43 +0000 Subject: pass the force argument to the xchan_photo daemon --- Zotlabs/Lib/Activity.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Lib/Activity.php') diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 5613e6bda..9178dac39 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -1875,7 +1875,7 @@ class Activity { } if ($icon) { - Master::Summon(['Xchan_photo', bin2hex($icon), bin2hex($url)]); + Master::Summon(['Xchan_photo', bin2hex($icon), bin2hex($url), $force]); } } -- cgit v1.2.3