aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-06-04 09:06:50 +0000
committerMario <mario@mariovavti.com>2024-06-04 09:06:50 +0000
commit7d7b43c5b932c76981e8420dfc55b4f9fbe6d3c6 (patch)
treee3ceb002012ce3b8b2d7137d45f3e6f98c4ea9db
parentb5223a4efbdc2243fb90badfb95be29b8989bdd0 (diff)
downloadvolse-hubzilla-7d7b43c5b932c76981e8420dfc55b4f9fbe6d3c6.tar.gz
volse-hubzilla-7d7b43c5b932c76981e8420dfc55b4f9fbe6d3c6.tar.bz2
volse-hubzilla-7d7b43c5b932c76981e8420dfc55b4f9fbe6d3c6.zip
hotfix to mitigate queueworker crash
(cherry picked from commit a4d63ab9a35a3e3c5e128e266e5ddc3c2c6d2e8e) Co-authored-by: Mario <mario@mariovavti.com>
-rw-r--r--Zotlabs/Lib/Activity.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 75d2ffbe9..43d91b59d 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;
}