kopia lustrzana https://github.com/friendica/friendica
Merge pull request #5901 from annando/catch-error
Catching error when compacting doesn't workpull/5906/head
commit
6b2a12319c
|
@ -92,7 +92,14 @@ class JsonLD
|
|||
|
||||
$jsonobj = json_decode(json_encode($json, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
|
||||
|
||||
$compacted = jsonld_compact($jsonobj, $context);
|
||||
|
||||
try {
|
||||
$compacted = jsonld_compact($jsonobj, $context);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
$compacted = false;
|
||||
logger('compacting error:' . print_r($e, true), LOGGER_DEBUG);
|
||||
}
|
||||
|
||||
return json_decode(json_encode($compacted, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), true);
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue