From f0d151932e384f6f8a9cb1ddf5ad278757b28b7c Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 6 Sep 2022 14:08:25 +0000 Subject: [PATCH] Issue 11890: Don't use empty contexts --- src/Protocol/ActivityPub/Receiver.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Protocol/ActivityPub/Receiver.php b/src/Protocol/ActivityPub/Receiver.php index ee07462b73..0cdbe82fc7 100644 --- a/src/Protocol/ActivityPub/Receiver.php +++ b/src/Protocol/ActivityPub/Receiver.php @@ -1869,8 +1869,10 @@ class Receiver $object_data['diaspora:comment'] = JsonLD::fetchElement($object, 'diaspora:comment', '@value'); $object_data['diaspora:like'] = JsonLD::fetchElement($object, 'diaspora:like', '@value'); $object_data['actor'] = $object_data['author'] = $actor; - $object_data['context'] = JsonLD::fetchElement($object, 'as:context', '@id'); - $object_data['conversation'] = JsonLD::fetchElement($object, 'ostatus:conversation', '@id'); + $element = JsonLD::fetchElement($object, 'as:context', '@id'); + $object_data['context'] = $element != './' ? $element : null; + $element = JsonLD::fetchElement($object, 'ostatus:conversation', '@id'); + $object_data['conversation'] = $element != './' ? $element : null; $object_data['sensitive'] = JsonLD::fetchElement($object, 'as:sensitive'); $object_data['name'] = JsonLD::fetchElement($object, 'as:name', '@value'); $object_data['summary'] = JsonLD::fetchElement($object, 'as:summary', '@value');