]> git.mxchange.org Git - friendica.git/commitdiff
Issue 12419: Quickhack to make GoToSocial work
authorMichael <heluecht@pirati.ca>
Mon, 19 Dec 2022 21:21:06 +0000 (21:21 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 19 Dec 2022 21:21:06 +0000 (21:21 +0000)
src/Util/JsonLD.php

index 51d15cb10afa93f9b844c05a54267feb1d6c76e1..4409b25dc59d22806b79be24a2aeb037d4147c0c 100644 (file)
@@ -177,6 +177,12 @@ class JsonLD
                        if (!in_array('https://w3id.org/security/v1', $json['@context'])) {
                                $json['@context'][] = 'https://w3id.org/security/v1';
                        }
+
+                       // Issue 12419: Workaround for GoToSocial
+                       $pos = array_search('http://joinmastodon.org/ns', $json['@context']);
+                       if (is_int($pos)) {
+                               $json['@context'][$pos] = ['toot' => 'http://joinmastodon.org/ns#'];
+                       }
                }
 
                // Bookwyrm transmits "id" fields with "null", which isn't allowed.