mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
改进Url类的parseDomain方法
This commit is contained in:
@@ -209,8 +209,13 @@ class Url
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} elseif (!strpos($domain, '.')) {
|
||||||
$domain .= strpos($domain, '.') ? '' : strstr($request->host(), '.');
|
$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;
|
return ($request->isSsl() ? 'https://' : 'http://') . $domain;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user