X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FUtil%2FJsonLD.php;h=8d609625e04281826f16ffec98d18f787dbce180;hb=6aa1dcfad371f34fea1f8e39b73de2cc3dd05784;hp=25ce74fcc7c1c044cebc7843f953e361e0a4baac;hpb=1edcd65e0eaca54320a5f5cc170273b3ac29eaed;p=friendica.git diff --git a/src/Util/JsonLD.php b/src/Util/JsonLD.php index 25ce74fcc7..8d609625e0 100644 --- a/src/Util/JsonLD.php +++ b/src/Util/JsonLD.php @@ -1,6 +1,6 @@ 'http://joinmastodon.org/ns#']; + } } // Bookwyrm transmits "id" fields with "null", which isn't allowed. @@ -203,6 +209,11 @@ class JsonLD $json = json_decode(json_encode($compacted, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), true); + if ($json === false) { + Logger::notice('JSON encode->decode failed', ['orig_json' => $orig_json, 'compacted' => $compacted]); + $json = []; + } + return $json; }