From da349413c2f9879f518b8ba6ceb48ba3e627f702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 16 Nov 2020 16:26:06 +0800 Subject: [PATCH] add clear --- wchat/common/HttpClient.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/wchat/common/HttpClient.php b/wchat/common/HttpClient.php index 48fadc1..f00de0f 100644 --- a/wchat/common/HttpClient.php +++ b/wchat/common/HttpClient.php @@ -195,7 +195,6 @@ class HttpClient */ public function setHost($host) { - var_dump($host); $this->host = $this->replaceHost($host); $match_quest = '/^[a-zA-Z\-]+(\.[a-zA-Z\-])+/'; if (preg_match($match_quest, $this->host)) { @@ -339,22 +338,22 @@ class HttpClient return false; } - if ($this->isHttp($string)) { - $_string = str_replace('http://', '', $string); - $hostAndUrls = explode('/', $string); + if ($this->isHttp($_string)) { + $_string = str_replace('http://', '', $_string); + $hostAndUrls = explode('/', $_string); $this->host = array_shift($hostAndUrls); $_string = implode('/', $hostAndUrls); - } else if ($this->isHttps($string)) { - $_string = str_replace('https://', '', $string); + } else if ($this->isHttps($_string)) { + $_string = str_replace('https://', '', $_string); $this->setIsSSL(true); - $hostAndUrls = explode('/', $string); + $hostAndUrls = explode('/', $_string); $this->host = array_shift($hostAndUrls); $_string = implode('/', $hostAndUrls); } else if (empty($this->host)) { - $hostAndUrls = explode('/', $string); + $hostAndUrls = explode('/', $_string); $this->host = array_shift($hostAndUrls); $_string = implode('/', $hostAndUrls);