output error if json_encode fails
This commit is contained in:
parent
81f9a59f25
commit
4e50717e12
@ -771,8 +771,14 @@ class ApiAction extends Action
|
|||||||
|
|
||||||
function showJsonObjects($objects)
|
function showJsonObjects($objects)
|
||||||
{
|
{
|
||||||
print(json_encode($objects));
|
$json_objects = json_encode($objects);
|
||||||
|
if($json_objects === false) {
|
||||||
|
$this->clientError(_('JSON encoding failed. Error: ').json_last_error_msg());
|
||||||
|
} else {
|
||||||
|
print $json_objects;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function showSingleXmlStatus($notice)
|
function showSingleXmlStatus($notice)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user