From fa36ae58baa4ba554f362dd63ac533205a3a0f52 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 1 Jun 2017 16:21:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BUrl=E7=B1=BB=E7=9A=84?= =?UTF-8?q?=E5=9F=9F=E5=90=8D=E4=BC=A0=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Url.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/think/Url.php b/library/think/Url.php index 51e2d89c..9f725e2c 100644 --- a/library/think/Url.php +++ b/library/think/Url.php @@ -272,7 +272,12 @@ class Url $domain .= '.' . $rootDomain; } } - return ($request->isSsl() || Config::get('is_https') ? 'https://' : 'http://') . $domain; + if (false !== strpos($domain, ':')) { + $scheme = ''; + } else { + $scheme = $request->isSsl() || Config::get('is_https') ? 'https://' : 'http://'; + } + return $scheme . $domain; } // 解析URL后缀