From 607d26e90676a8ab9a6a824aba9918753a61109d Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 7 Dec 2022 22:35:37 -0500 Subject: [PATCH] Ward against empty JsonLD::fetchElement result in ActivityPub\Receiver::processTags - Address https://github.com/friendica/friendica/issues/12011#issuecomment-1336478368 --- src/Protocol/ActivityPub/Receiver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Protocol/ActivityPub/Receiver.php b/src/Protocol/ActivityPub/Receiver.php index 4e2bcceafb..8939822742 100644 --- a/src/Protocol/ActivityPub/Receiver.php +++ b/src/Protocol/ActivityPub/Receiver.php @@ -209,7 +209,7 @@ class Receiver Logger::notice('No object data found', ['type' => $type, 'object_type' => $object_type, 'object_id' => $object_id, 'actor' => $actor, 'activity' => $activity]); return; } - + if (self::routeActivities($object_data, $type, true)) { Logger::debug('Handled activity', ['type' => $type, 'object_type' => $object_type, 'object_id' => $object_id, 'actor' => $actor]); } else { @@ -1472,7 +1472,7 @@ class Receiver continue; } - $element = ['type' => str_replace('as:', '', JsonLD::fetchElement($tag, '@type')), + $element = ['type' => str_replace('as:', '', JsonLD::fetchElement($tag, '@type') ?? ''), 'href' => JsonLD::fetchElement($tag, 'as:href', '@id'), 'name' => JsonLD::fetchElement($tag, 'as:name', '@value')]; -- 2.39.5