改名
This commit is contained in:
@@ -706,7 +706,6 @@ abstract class ClientAbstracts extends Component implements IClient
|
|||||||
*/
|
*/
|
||||||
protected function matchHost(string $string)
|
protected function matchHost(string $string)
|
||||||
{
|
{
|
||||||
var_dump($string);
|
|
||||||
if (($parse = isUrl($string, true)) === false) {
|
if (($parse = isUrl($string, true)) === false) {
|
||||||
return $this->defaultString($string);
|
return $this->defaultString($string);
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-3
@@ -46,11 +46,14 @@ if (!function_exists('isUrl')) {
|
|||||||
*/
|
*/
|
||||||
function isUrl($url, $get_info = true)
|
function isUrl($url, $get_info = true)
|
||||||
{
|
{
|
||||||
$queryMatch = '/((http[s]?):\/\/)?(([\w-_]+\.)+\w+(:\d+)?)(\/.*)?/';
|
try {
|
||||||
if (!preg_match($queryMatch, $url, $outPut)) {
|
$queryMatch = '/((http[s]?):\/\/)?(([\w-_]+\.)+\w+(:\d+)?)(\/.*)?/';
|
||||||
|
if (!preg_match($queryMatch, $url, $outPut)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}catch (Throwable $exception){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$port = str_replace(':', '', $outPut[5]);
|
$port = str_replace(':', '', $outPut[5]);
|
||||||
|
|
||||||
[$isHttps, $domain, $port, $path] = [$outPut[2] == 'https', $outPut[3], $port, $outPut[6] ?? ''];
|
[$isHttps, $domain, $port, $path] = [$outPut[2] == 'https', $outPut[3], $port, $outPut[6] ?? ''];
|
||||||
|
|||||||
Reference in New Issue
Block a user