From 087d114af2e1c4bdc0dd8b168a553321bf33bbb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 18 Nov 2020 14:59:22 +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 --- HttpServer/Client/ClientAbstracts.php | 7 +------ HttpServer/Client/Curl.php | 2 -- System/Core/Help.php | 4 ++-- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/HttpServer/Client/ClientAbstracts.php b/HttpServer/Client/ClientAbstracts.php index 8ee81fa4..c9a6de56 100644 --- a/HttpServer/Client/ClientAbstracts.php +++ b/HttpServer/Client/ClientAbstracts.php @@ -600,12 +600,7 @@ abstract class ClientAbstracts extends Component implements IClient } else if (strpos($type, 'xml') !== false) { return Help::xmlToArray($body); } else if (strpos($type, 'plain') !== false) { - if (!is_null($json = JSON::decode($body))) { - return $json; - } - if (!is_null($json = Help::toArray($body))) { - return $json; - } + return Help::toArray($body); } return $body; } diff --git a/HttpServer/Client/Curl.php b/HttpServer/Client/Curl.php index 932e9cff..2d1228c3 100644 --- a/HttpServer/Client/Curl.php +++ b/HttpServer/Client/Curl.php @@ -179,8 +179,6 @@ class Curl extends ClientAbstracts $status = (int)explode(' ', trim($header[0]))[1]; $header = $this->headerFormat($header); - var_dump($this->resolve($header, $body)); - return [$header, $this->resolve($header, $body), $status]; } diff --git a/System/Core/Help.php b/System/Core/Help.php index c75a80e4..93726901 100644 --- a/System/Core/Help.php +++ b/System/Core/Help.php @@ -38,13 +38,13 @@ class Help public static function toArray($xml) { if (empty($xml)) { - return []; + return null; } else if (is_array($xml)) { return $xml; } $xml = Xml::isXml($xml); if (!$xml) { - return []; + return static::jsonToArray($xml); } return $xml; }