From 559d832b65df0f7349e0081d98b367e1054cb3b0 Mon Sep 17 00:00:00 2001 From: zhaoxiang <756958008@qq.com> Date: Thu, 22 Feb 2018 23:08:18 +0800 Subject: [PATCH] =?UTF-8?q?modified=20=E6=B7=BB=E5=8A=A0JSON=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=B8=B2=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Fields.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/application/admin/controller/Fields.php b/application/admin/controller/Fields.php index 523f75b..68d7217 100644 --- a/application/admin/controller/Fields.php +++ b/application/admin/controller/Fields.php @@ -150,6 +150,9 @@ class Fields extends Base { $jsonStr = $this->request->post('jsonStr'); $jsonStr = html_entity_decode($jsonStr); $data = json_decode($jsonStr, true); + if ($data === null) { + return $this->buildFailed(ReturnCode::EXCEPTION, 'JSON数据格式有误'); + } ApiList::update(['returnStr' => json_encode($data)], ['hash' => $hash]); $this->handle($data['data'], $dataArr); $old = (new ApiFields())->where([