From 0295340e4b9b6f7add00cee206cfe65ac4069da2 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 27 Jun 2016 18:40:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3Url=E7=B1=BB=E4=B8=80?= =?UTF-8?q?=E5=A4=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Url.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/library/think/Url.php b/library/think/Url.php index 0a88bf7a..0d9bd418 100644 --- a/library/think/Url.php +++ b/library/think/Url.php @@ -324,10 +324,6 @@ class Url // 分析路由规则中的变量 private static function parseVar($rule) { - // 检测是否设置了参数分隔符 - if ($depr = Config::get('url_params_depr')) { - $rule = str_replace($depr, '/', $rule); - } // 提取路由规则中的变量 $var = []; foreach (explode('/', $rule) as $val) { @@ -344,6 +340,9 @@ class Url } } + if ('$' == substr($val, -1, 1)) { + $val = substr($val, 0, -1); + } if (0 === strpos($val, '[:')) { // 可选参数 $optional = true;