From 997131e3271b4fc1d532e6f1ff4b60dc4cdd07a4 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Sun, 13 Oct 2019 00:22:53 +0900 Subject: [PATCH] Update json.format.php --- helper/json.format.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/helper/json.format.php b/helper/json.format.php index 9024901..d6b56ec 100644 --- a/helper/json.format.php +++ b/helper/json.format.php @@ -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;