Update database.php

This commit is contained in:
Namhyeon Go 2019-02-26 11:50:25 +09:00 committed by GitHub
parent 0f744857d4
commit 653518d50d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -482,12 +482,12 @@ if(check_valid_function("json_decode_to_assoc")) {
function json_decode_to_assoc($data) { function json_decode_to_assoc($data) {
$result = array(); $result = array();
$fn = array( $invalid_fn = array(
"NO_FUNCTION_JSON_DECODE" => "json_decode", "NO_FUNCTION_JSON_DECODE" => "json_decode",
"NO_FUNCTION_JSON_LAST_ERROR" => "json_last_error", "NO_FUNCTION_JSON_LAST_ERROR" => "json_last_error",
); );
$error = check_invaild_function($fn); $error = check_invaild_function($invalid_fn);
if($error == -1) { if($error == -1) {
$obj = @json_decode($data, true); $obj = @json_decode($data, true);
$result = (@json_last_error() === 0) ? $obj : $result; $result = (@json_last_error() === 0) ? $obj : $result;