From d8e062dbbe4ea991fd6ecc3ad035cd27d5c4d522 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sat, 26 Mar 2016 21:30:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3Route=E7=B1=BB=E7=9A=84?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Route.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/library/think/Route.php b/library/think/Route.php index 6fbf2f3f..9b79659f 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -506,7 +506,7 @@ class Route // 执行闭包 return ['type' => 'function', 'function' => $route, 'params' => $match]; } - return self::parseRule($rule, $route, $url); + return self::parseRule($rule, $route, $url, $match); } } return false; @@ -641,15 +641,14 @@ class Route } // 解析规则路由 - private static function parseRule($rule, $route, $pathinfo) + private static function parseRule($rule, $route, $pathinfo, $matches) { // 获取URL地址中的参数 $paths = explode('/', $pathinfo); // 获取路由地址规则 $url = is_array($route) ? $route[0] : $route; // 解析路由规则 - $matches = []; - $rule = explode('/', $rule); + $rule = explode('/', $rule); foreach ($rule as $item) { $fun = ''; if (0 === strpos($item, '[:')) {