diff --git a/wchat/common/HttpClient.php b/wchat/common/HttpClient.php index a04e5d1..7ef8097 100644 --- a/wchat/common/HttpClient.php +++ b/wchat/common/HttpClient.php @@ -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; }