diff --git a/library/think/Url.php b/library/think/Url.php index de3cd912..d6e57037 100644 --- a/library/think/Url.php +++ b/library/think/Url.php @@ -268,7 +268,7 @@ class Url $host = $request->host(); $rootDomain = substr_count($host, '.') > 1 ? substr(strstr($host, '.'), 1) : $host; } - if (!strpos($domain, $rootDomain)) { + if (substr_count($domain, '.') < 2 && !strpos($domain, $rootDomain)) { $domain .= '.' . $rootDomain; } }