From a3b3b4b1c1b8ecd5d1492615070d698d7b735fb3 Mon Sep 17 00:00:00 2001 From: Anyon Date: Tue, 15 May 2018 09:50:25 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E4=BF=AE=E6=AD=A3=E7=A9=BA?= =?UTF-8?q?=E6=95=B0=E7=BB=84=E8=BD=ACJSON=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WeChat/Contracts/Tools.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WeChat/Contracts/Tools.php b/WeChat/Contracts/Tools.php index 4cfe9b8..a9bf0a9 100644 --- a/WeChat/Contracts/Tools.php +++ b/WeChat/Contracts/Tools.php @@ -155,7 +155,7 @@ class Tools { return preg_replace_callback('/\\\\u([0-9a-f]{4})/i', function ($matches) { return mb_convert_encoding(pack("H*", $matches[1]), "UTF-8", "UCS-2BE"); - }, json_encode($data)); + }, ($jsonData = json_encode($data)) == '[]' ? '{}' : $jsonData); } /**