From 5f83915a940ef6ab3a127430a81b8d4d0eb1cff8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 8 Mar 2021 15:00:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- System/Core/Json.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/System/Core/Json.php b/System/Core/Json.php index 92cd81b0..052c61d3 100644 --- a/System/Core/Json.php +++ b/System/Core/Json.php @@ -45,9 +45,10 @@ class Json */ public static function decode($data, $asArray = true): mixed { - if (is_array($data)) { + if (is_array($data) || is_numeric($data)) { return $data; } + if (!is_string($data)) return null; return json_decode($data, $asArray); }