Check for json_last_error function existence before invoking.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@3482 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
parent
b40669dc75
commit
a3ef933f2d
|
@ -2206,20 +2206,23 @@ function isVector ( &$array )
|
|||
|
||||
function checkJsonError()
|
||||
{
|
||||
switch( json_last_error() )
|
||||
if ( function_exists('json_last_error') )
|
||||
{
|
||||
case JSON_ERROR_DEPTH :
|
||||
Fatal( "Unable to decode JSON string '$value', maximum stack depth exceeded" );
|
||||
case JSON_ERROR_CTRL_CHAR :
|
||||
Fatal( "Unable to decode JSON string '$value', unexpected control character found" );
|
||||
case JSON_ERROR_STATE_MISMATCH :
|
||||
Fatal( "Unable to decode JSON string '$value', invalid or malformed JSON" );
|
||||
case JSON_ERROR_SYNTAX :
|
||||
Fatal( "Unable to decode JSON string '$value', syntax error" );
|
||||
default :
|
||||
Fatal( "Unable to decode JSON string '$value', unexpected error ".json_last_error() );
|
||||
case JSON_ERROR_NONE:
|
||||
break;
|
||||
switch( json_last_error() )
|
||||
{
|
||||
case JSON_ERROR_DEPTH :
|
||||
Fatal( "Unable to decode JSON string '$value', maximum stack depth exceeded" );
|
||||
case JSON_ERROR_CTRL_CHAR :
|
||||
Fatal( "Unable to decode JSON string '$value', unexpected control character found" );
|
||||
case JSON_ERROR_STATE_MISMATCH :
|
||||
Fatal( "Unable to decode JSON string '$value', invalid or malformed JSON" );
|
||||
case JSON_ERROR_SYNTAX :
|
||||
Fatal( "Unable to decode JSON string '$value', syntax error" );
|
||||
default :
|
||||
Fatal( "Unable to decode JSON string '$value', unexpected error ".json_last_error() );
|
||||
case JSON_ERROR_NONE:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue