From 1865dfa8fd8b820aae2df12a56dc4c87c84f1057 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Sat, 2 Nov 2024 20:48:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8E=BB=E9=99=A4=20route->getBind()=20?= =?UTF-8?q?=E7=94=A8=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/think-library/src/support/Url.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/plugin/think-library/src/support/Url.php b/plugin/think-library/src/support/Url.php index df0cea78b..777a5d6ea 100644 --- a/plugin/think-library/src/support/Url.php +++ b/plugin/think-library/src/support/Url.php @@ -134,15 +134,6 @@ class Url extends ThinkUrl $bind = $this->route->getDomainBind($domain && is_string($domain) ? $domain : null); if ($bind && 0 === strpos($url, $bind)) { $url = substr($url, strlen($bind) + 1); - } else { - $binds = $this->route->getBind(); - foreach ($binds as $key => $val) { - if (is_string($val) && 0 === strpos($url, $val) && substr_count($val, '/') > 1) { - $url = substr($url, strlen($val) + 1); - $domain = $key; - break; - } - } } // 路由标识不存在 直接解析 $url = $this->parseUrl($url, $domain); @@ -185,8 +176,7 @@ class Url extends ThinkUrl $url .= $suffix . '?' . $vars . $anchor; } else { foreach ($vars as $var => $val) { - $val = (string)$val; - if ('' !== $val) { + if ('' !== ($val = (string)$val)) { $url .= $depr . $var . $depr . urlencode($val); } }