Skip to content

Commit

Permalink
Merge pull request ZoneMinder#256 from Phhere/patch-1
Browse files Browse the repository at this point in the history
Fix checkJsonError messages
  • Loading branch information
mastertheknife committed Dec 4, 2013
2 parents 219ada8 + d4babd2 commit 5a256eb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions web/includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2225,10 +2225,11 @@ function isVector ( &$array )
return( true );
}

function checkJsonError()
function checkJsonError($value)
{
if ( function_exists('json_last_error') )
{
$value = var_export($value,true);
switch( json_last_error() )
{
case JSON_ERROR_DEPTH :
Expand All @@ -2252,7 +2253,7 @@ function jsonEncode( &$value )
if ( function_exists('json_encode') )
{
$string = json_encode( $value );
checkJsonError();
checkJsonError($value);
return( $string );
}

Expand Down Expand Up @@ -2293,7 +2294,7 @@ function jsonDecode( $value )
if ( function_exists('json_decode') )
{
$object = json_decode( $value, true );
checkJsonError();
checkJsonError($value);
return( $object );
}

Expand Down

0 comments on commit 5a256eb

Please sign in to comment.