]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/JsonLD.php
Merge pull request #11973 from MrPetovan/task/test-fixDateFormat
[friendica.git] / src / Util / JsonLD.php
index 1200a9cbed4a4c1a273e181646a15c042a8ac096..25ce74fcc7c1c044cebc7843f953e361e0a4baac 100644 (file)
@@ -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 {