This commit is contained in:
2020-11-17 18:41:38 +08:00
parent cd93ba6c3a
commit 75e6184d35
+2 -6
View File
@@ -46,12 +46,8 @@ if (!function_exists('isUrl')) {
*/ */
function isUrl($url, $get_info = true) function isUrl($url, $get_info = true)
{ {
try { $queryMatch = '/((http[s]?):\/\/)?(([\w\-\_]+\.)+\w+(:\d+)?)(\/.*)?/';
$queryMatch = '/((http[s]?):\/\/)?(([\w\-\_]+\.)+\w+(:\d+)?)(\/.*)?/'; if (!preg_match($queryMatch, $url, $outPut)) {
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]);