From dea36a9be56905d1b19ce028d0c09c26f89a56fd Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Thu, 19 Dec 2019 10:51:57 +0800 Subject: [PATCH] add clear --- common/HttpClient.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/common/HttpClient.php b/common/HttpClient.php index a5ca7a3..9cb2c19 100644 --- a/common/HttpClient.php +++ b/common/HttpClient.php @@ -240,6 +240,9 @@ class HttpClient */ private function parseUrlHost(&$url) { + if (!empty($this->host)) { + return $this->host; + } if ($this->isHttp($url)) { $url = str_replace('http://', '', $url); } else if ($this->isHttps($url)) { @@ -252,13 +255,8 @@ class HttpClient if ($this->port !== 443) { $this->isSSL = false; } + $url = '/' . implode('/', $explode); } - - $url = '/' . implode('/', $explode); - if (!empty($this->host)) { - return $this->host; - } - if (preg_match('/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/', $first)) { return $first; }