From 9c349c86ed5dafb409918157b02b1c064bff631a Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 22 Aug 2016 16:42:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0route=5Fcomplete=5Fmatch?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=8F=82=E6=95=B0=E8=AE=BE=E7=BD=AE=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E8=B7=AF=E7=94=B1=E8=A7=84=E5=88=99=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E9=87=87=E7=94=A8=E5=AE=8C=E6=95=B4=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=20=E5=8F=AF=E4=BB=A5=E7=94=B1=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E8=A7=84=E5=88=99=E7=9A=84=E5=8F=82=E6=95=B0complete=5Fmatch?= =?UTF-8?q?=20=E8=BF=9B=E8=A1=8C=E8=A6=86=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Route.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/library/think/Route.php b/library/think/Route.php index 63da7850..837fdef0 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -284,10 +284,14 @@ class Route } elseif (is_string($route)) { $name = $route; } - if ('$' == substr($rule, -1, 1)) { - // 是否完整匹配 - $option['complete_match'] = true; - $rule = substr($rule, 0, -1); + if (!isset($option['complete_match'])) { + if (Config::get('route_complete_match')) { + $option['complete_match'] = true; + } elseif ('$' == substr($rule, -1, 1)) { + // 是否完整匹配 + $option['complete_match'] = true; + $rule = substr($rule, 0, -1); + } } if ('/' != $rule) { $rule = trim($rule, '/');