Revert "改名"

This reverts commit fdf58326
This commit is contained in:
2021-12-28 14:16:45 +08:00
parent 93ce4c16b6
commit 03287cfd65
+10 -5
View File
@@ -236,7 +236,9 @@ if (!class_exists('ReturnTypeWillChange')) {
#[Attribute(Attribute::TARGET_METHOD)] #[Attribute(Attribute::TARGET_METHOD)]
final class ReturnTypeWillChange final class ReturnTypeWillChange
{ {
public function __construct() {} public function __construct()
{
}
} }
@@ -344,16 +346,19 @@ if (!function_exists('isUrl')) {
if (!preg_match($queryMatch, $url, $outPut)) { if (!preg_match($queryMatch, $url, $outPut)) {
return FALSE; return FALSE;
} }
$port = str_replace(':', '', $outPut[5]);
[$isHttps, $domain, $port, $path] = [$outPut[2] == 'https', $outPut[3], $port, $outPut[6] ?? '']; [$scheme, $host, $port, $user, $pass, $query, $path, $fragment] = parse_url($url);
if ($isHttps && empty($port)) { if ($scheme == 'https' && empty($port)) {
$port = 443; $port = 443;
} }
if (!empty($query)) $path .= '?' . $query;
if (!empty($fragment)) $path .= '#' . $fragment;
unset($outPut); unset($outPut);
return [$isHttps == 'https', $domain, $port, $path]; return [$scheme == 'https', $host, $port, $path];
} }
} }