From f50140bbe24cd2e243b259f42609aadb6c94da43 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 9 Oct 2016 23:31:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E8=B7=AF=E7=94=B1=E8=A7=84?= =?UTF-8?q?=E5=88=99=E7=9A=84=E7=BB=84=E5=90=88=E5=8F=98=E9=87=8F=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E7=9A=84=E6=97=B6=E5=80=99=20=E5=8F=AF=E9=80=89?= =?UTF-8?q?=E5=88=86=E9=9A=94=E7=AC=A6=E7=9A=84=E9=97=AE=E9=A2=98=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E4=BD=BF=E7=94=A8=20Route::rules('item-(-=3F)','item/read');?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Url.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/think/Url.php b/library/think/Url.php index 4e145702..77d9f32b 100644 --- a/library/think/Url.php +++ b/library/think/Url.php @@ -77,6 +77,8 @@ class Url if (!empty($rule) && $match = self::getRuleUrl($rule, $vars)) { // 匹配路由命名标识 $url = $match[0]; + // 替换可选分隔符 + $url = preg_replace(['/\((\W)\?\)$/', '/\((\W)\?\)/'], ['', '\1'], $url); if (!empty($match[1])) { $domain = $match[1]; }