]> git.mxchange.org Git - friendica.git/commitdiff
Account for missing location value in ActivityPub\Receiver
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 7 May 2020 13:17:16 +0000 (09:17 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Thu, 7 May 2020 14:14:38 +0000 (10:14 -0400)
src/Protocol/ActivityPub/Receiver.php

index 2f5332bef75bb0ffb4666457018804d05c36255d..384f5b5952ac8bd7b67ed9eaf3dd6a90ec29d50b 100644 (file)
@@ -1059,12 +1059,13 @@ class Receiver
 
                $location = JsonLD::fetchElement($object, 'as:location', 'as:name', '@type', 'as:Place');
                $location = JsonLD::fetchElement($location, 'location', '@value');
-
-               // Some AP software allow formatted text in post location, so we run all the text converters we have to boil
-               // down to HTML and then finally format to plaintext.
-               $location = Markdown::convert($location);
-               $location = BBCode::convert($location);
-               $location = HTML::toPlaintext($location);
+               if ($location) {
+                       // Some AP software allow formatted text in post location, so we run all the text converters we have to boil
+                       // down to HTML and then finally format to plaintext.
+                       $location = Markdown::convert($location);
+                       $location = BBCode::convert($location);
+                       $location = HTML::toPlaintext($location);
+               }
 
                $object_data['sc:identifier'] = JsonLD::fetchElement($object, 'sc:identifier', '@value');
                $object_data['diaspora:guid'] = JsonLD::fetchElement($object, 'diaspora:guid', '@value');