mirror of
https://github.com/friendica/friendica
synced 2025-04-30 09:44:22 +02:00
Fix JsonLD parsing problems with GoToSocial
This commit is contained in:
parent
98e50a49f0
commit
407e6389b3
3 changed files with 57 additions and 6 deletions
|
@ -55,6 +55,12 @@ class JsonLD
|
|||
case 'https://funkwhale.audio/ns':
|
||||
$url = DI::basePath() . '/static/funkwhale.audio.jsonld';
|
||||
break;
|
||||
case 'http://schema.org':
|
||||
$url = DI::basePath() . '/static/schema.jsonld';
|
||||
break;
|
||||
case 'http://joinmastodon.org/ns':
|
||||
$url = DI::basePath() . '/static/joinmastodon.jsonld';
|
||||
break;
|
||||
default:
|
||||
switch (parse_url($url, PHP_URL_PATH)) {
|
||||
case '/schemas/litepub-0.1.jsonld';
|
||||
|
@ -177,12 +183,6 @@ 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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue