From 7ea28f47e19a0950ef721432ee73edba5b6b515d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Fri, 23 Sep 2022 19:02:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RpcJsonp.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RpcJsonp.php b/RpcJsonp.php index 4ab7b55..e6c16bd 100644 --- a/RpcJsonp.php +++ b/RpcJsonp.php @@ -158,7 +158,8 @@ class RpcJsonp extends Component implements OnConnectInterface, OnReceiveInterfa public function onReceive(Server $server, int $fd, int $reactor_id, string $data): bool { try { - if (!isJson($data)) return $server->send($fd, 'success', $reactor_id); + $data = json_decode($data, true); + if (is_null($data)) return $server->send($fd, 'success', $reactor_id); $data = json_decode($data, true); if (!is_array($data)) { throw new Exception('Parse error语法解析错误', -32700);