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