]> git.mxchange.org Git - friendica.git/commitdiff
Ward against empty JsonLD::fetchElement result in ActivityPub\Receiver::processTags
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 8 Dec 2022 03:35:37 +0000 (22:35 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 10 Dec 2022 16:38:42 +0000 (11:38 -0500)
- Address https://github.com/friendica/friendica/issues/12011#issuecomment-1336478368

src/Protocol/ActivityPub/Receiver.php

index 4e2bcceafbc0efc8bf3cfa6b1e6a59066ff8149b..89398227422a411f7de6b25e452360cdab9c3238 100644 (file)
@@ -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')];