Update json.format.php

This commit is contained in:
Namhyeon Go 2019-10-13 00:22:53 +09:00 committed by GitHub
parent f1d50b8a51
commit 997131e327
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,12 +11,15 @@ if(!check_function_exists("json_decode_ex")) {
);
$error = check_invaild_function($invalid_fn);
if($error < 0) {
$_result = false;
if(array_key_equals("assoc", $options, true)) {
$obj = @json_decode($data, true);
$_result = @json_decode($data, true);
} else {
$obj = @json_decode($data);
$_result = @json_decode($data);
}
if(@json_last_error() === 0) {
$result = $_result;
}
$result = (@json_last_error() === 0) ? $obj : $result;
}
return $result;