Fix checkJsonError messages

The $value string was not set inside checkJsonError, so it was not possible to see the data which caused the error
This commit is contained in:
Philipp Rehs 2013-11-30 18:13:02 +01:00
parent d0debfa450
commit d4babd23f1
1 changed files with 4 additions and 3 deletions

View File

@ -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 :
@ -2252,7 +2253,7 @@ function jsonEncode( &$value )
if ( function_exists('json_encode') )
{
$string = json_encode( $value );
checkJsonError();
checkJsonError($value);
return( $string );
}
@ -2293,7 +2294,7 @@ function jsonDecode( $value )
if ( function_exists('json_decode') )
{
$object = json_decode( $value, true );
checkJsonError();
checkJsonError($value);
return( $object );
}