From a8e4ee762f0f1a9362f7a1034591af19165403c3 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 19 Jan 2016 12:18:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BUrl=E7=B1=BB=E5=AF=B9?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E5=88=B0=E7=B1=BB=E7=9A=84=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Url.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/library/think/Url.php b/library/think/Url.php index 2f47a7e0..22addb5b 100644 --- a/library/think/Url.php +++ b/library/think/Url.php @@ -24,7 +24,7 @@ class Url * @param boolean|string $domain 是否显示域名 或者直接传入域名 * @return string */ - public static function build($url = '', $vars = '', $suffix = true, $domain = true) + public static function build($url = '', $vars = '', $suffix = true, $domain = false) { // 解析参数 if (is_string($vars)) { @@ -226,7 +226,9 @@ class Url $key = array_shift($route); } $route = $route[0]; - if (strpos($route, '?')) { + if (is_array($route)) { + $route = implode('\\', $route); + } elseif (strpos($route, '?')) { $route = strstr($route, '?', true); } $var = self::parseVar($rule . '/' . $key); @@ -234,7 +236,9 @@ class Url } } else { $route = $val['route']; - if (strpos($route, '?')) { + if (is_array($route)) { + $route = implode('\\', $route); + } elseif (strpos($route, '?')) { $route = strstr($route, '?', true); } $var = self::parseVar($rule);