X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FUtil%2FJsonLD.php;h=25ce74fcc7c1c044cebc7843f953e361e0a4baac;hb=fe442683efb8b75394d7df041716c47c81b05fbc;hp=1200a9cbed4a4c1a273e181646a15c042a8ac096;hpb=8db0e090d7afc3fbfeaf7a587140c80c98233484;p=friendica.git diff --git a/src/Util/JsonLD.php b/src/Util/JsonLD.php index 1200a9cbed..25ce74fcc7 100644 --- a/src/Util/JsonLD.php +++ b/src/Util/JsonLD.php @@ -157,6 +157,8 @@ class JsonLD 'sc' => (object)['@id' => 'http://schema.org#', '@type' => '@id'], 'pt' => (object)['@id' => 'https://joinpeertube.org/ns#', '@type' => '@id'], 'mobilizon' => (object)['@id' => 'https://joinmobilizon.org/ns#', '@type' => '@id'], + 'fedibird' => (object)['@id' => 'http://fedibird.com/ns#', '@type' => '@id'], + 'misskey' => (object)['@id' => 'https://misskey-hub.net/ns#', '@type' => '@id'], ]; $orig_json = $json; @@ -177,6 +179,13 @@ class JsonLD } } + // Bookwyrm transmits "id" fields with "null", which isn't allowed. + array_walk_recursive($json, function (&$value, $key) { + if ($key == 'id' && is_null($value)) { + $value = ''; + } + }); + $jsonobj = json_decode(json_encode($json, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)); try {