mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
改进Url类的parseDomain方法
This commit is contained in:
@@ -209,8 +209,13 @@ class Url
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$domain .= strpos($domain, '.') ? '' : strstr($request->host(), '.');
|
||||
} elseif (!strpos($domain, '.')) {
|
||||
$rootDomain = Config::get('url_domain_root');
|
||||
if (empty($rootDomain)) {
|
||||
$host = $request->host();
|
||||
$rootDomain = substr_count($host, '.') > 1 ? substr(strstr($host, '.'), 1) : $host;
|
||||
}
|
||||
$domain .= '.' . $rootDomain;
|
||||
}
|
||||
return ($request->isSsl() ? 'https://' : 'http://') . $domain;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user