From 8673d5254893ee80ac1fa93b1ff8140baed1b1ac Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 5 Aug 2016 18:32:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BRoute=E7=B1=BB=E7=9A=84?= =?UTF-8?q?=E5=A4=8D=E5=90=88=E5=8F=98=E9=87=8F=E6=A3=80=E6=B5=8B=20?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89=E5=AE=9A=E4=B9=89=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E8=A7=84=E5=88=99=20=E9=BB=98=E8=AE=A4=E4=B8=BA=20\w+?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Route.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/think/Route.php b/library/think/Route.php index 966e569e..2ada5acf 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -1204,9 +1204,9 @@ class Route foreach ($matches[1] as $name) { if (strpos($name, '?')) { $name = substr($name, 0, -1); - $replace[] = '(' . (isset($pattern[$name]) ? $pattern[$name] : '') . '?)'; + $replace[] = '(' . (isset($pattern[$name]) ? $pattern[$name] : '\w+') . '?)'; } else { - $replace[] = '(' . (isset($pattern[$name]) ? $pattern[$name] : '') . ')'; + $replace[] = '(' . (isset($pattern[$name]) ? $pattern[$name] : '\w+') . ')'; } $value[] = $name; }