From 200e51c3b14322f7abdc52a8a70e6bf0b09b956b Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 24 May 2016 18:30:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BRoute=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Route.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/think/Route.php b/library/think/Route.php index 60521ac3..51ac3b40 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -401,7 +401,7 @@ class Route if (strpos($val[1], ':id') && isset($option['var'][$rule])) { $val[1] = str_replace(':id', ':' . $option['var'][$rule], $val[1]); } - $rule = $rule . $val[1]; + $rule = ltrim($rule . $val[1], '/'); self::rule($rule ? $rule . '$' : '', $route . '/' . $val[2], $val[0], $option, $pattern); } }