From c9d7f528450dbabb8d4bc77514dc74365f85df5f Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Fri, 3 Jan 2020 11:46:51 +0800 Subject: [PATCH] add clear --- common/HttpClient.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/common/HttpClient.php b/common/HttpClient.php index b43d72a..6fc68ff 100644 --- a/common/HttpClient.php +++ b/common/HttpClient.php @@ -469,13 +469,10 @@ class HttpClient } if (strpos($type, 'json') !== false) { return json_decode($body, true); - } else if (strpos($type, 'xml') !== false || strpos($type, 'plain') !== false) { - if (!is_null($newBody = json_decode($body, true))) { - return $newBody; - } + } else if (strpos($type, 'xml') !== false) { return Help::toArray($body); } else if (strpos($type, 'plain') !== false) { - return json_decode($body, TRUE); + return Help::toArray($body); } else { return $body; }