]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/JsonLD.php
Merge pull request #12591 from MrPetovan/task/2023-licence
[friendica.git] / src / Util / JsonLD.php
index 51d15cb10afa93f9b844c05a54267feb1d6c76e1..8d609625e04281826f16ffec98d18f787dbce180 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -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.