From 16b33bc372b4852a1890908db68009d23ef50924 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sat, 25 Feb 2017 17:04:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BUrl=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=AF=B9=E5=AE=8C=E6=95=B4=E5=9F=9F=E5=90=8D=E7=9A=84=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Url.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } }