add clear

This commit is contained in:
2020-04-30 18:17:29 +08:00
parent a7d2121bf0
commit 7bda1dbcce
+17 -1
View File
@@ -311,7 +311,23 @@ class HttpClient
if (!$this->checkIsIp($this->host)) {
$this->host = System::gethostbyname($this->host);
}
var_dump($this->host, $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);
$this->setIsSSL(true);
$hostAndUrls = explode('/', $string);
$this->host = array_shift($hostAndUrls);
$string = implode('/', $hostAndUrls);
}
return $string;
}