diff --git a/HttpServer/Client/ClientAbstracts.php b/HttpServer/Client/ClientAbstracts.php index c4b4947a..576f892f 100644 --- a/HttpServer/Client/ClientAbstracts.php +++ b/HttpServer/Client/ClientAbstracts.php @@ -706,7 +706,6 @@ abstract class ClientAbstracts extends Component implements IClient */ protected function matchHost(string $string) { - var_dump($string); if (($parse = isUrl($string, true)) === false) { return $this->defaultString($string); } diff --git a/function.php b/function.php index 4d8a9b83..1a105849 100644 --- a/function.php +++ b/function.php @@ -46,11 +46,14 @@ if (!function_exists('isUrl')) { */ function isUrl($url, $get_info = true) { - $queryMatch = '/((http[s]?):\/\/)?(([\w-_]+\.)+\w+(:\d+)?)(\/.*)?/'; - if (!preg_match($queryMatch, $url, $outPut)) { + try { + $queryMatch = '/((http[s]?):\/\/)?(([\w-_]+\.)+\w+(:\d+)?)(\/.*)?/'; + if (!preg_match($queryMatch, $url, $outPut)) { + return false; + } + }catch (Throwable $exception){ return false; } - $port = str_replace(':', '', $outPut[5]); [$isHttps, $domain, $port, $path] = [$outPut[2] == 'https', $outPut[3], $port, $outPut[6] ?? ''];