From b9f0fb136884846a3c9c4ae57535dcfc1fe3cd99 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Tue, 26 Feb 2019 11:20:54 +0900 Subject: [PATCH] Update database.php --- system/database.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/system/database.php b/system/database.php index 384b259..2a809fc 100644 --- a/system/database.php +++ b/system/database.php @@ -482,12 +482,13 @@ if(!function_exists("json_decode_to_assoc")) { function json_decode_to_assoc($data) { $result = array(); - $func_rules = array( - "json_decode" => "Dose not exists json_decode function", - "json_last_error" => "Dose not exists json_last_error function", + $fn = array( + "NO_FUNCTION_JSON_DECODE" => "json_decode", + "NO_FUNCTION_JSON_LAST_ERROR" => "json_last_error", ); - if(check_function_exists($func_rules)) { + $error = check_invaild_function($fn); + if($error == -1) { $obj = @json_decode($data, true); $result = (@json_last_error() === 0) ? $obj : $result; }