From e733adcaae54d0efbf537e62eb9380c83b49c0bd Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 19 Dec 2022 21:21:06 +0000 Subject: [PATCH] Issue 12419: Quickhack to make GoToSocial work --- src/Util/JsonLD.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Util/JsonLD.php b/src/Util/JsonLD.php index 51d15cb10a..4409b25dc5 100644 --- a/src/Util/JsonLD.php +++ b/src/Util/JsonLD.php @@ -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.