From bebe73e5a79d8c8b360bf6da4b6e967653ab35b8 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 1 Jun 2016 14:40:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E8=B7=AF=E7=94=B1=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E7=9A=84=E5=8F=82=E6=95=B0=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Route.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/library/think/Route.php b/library/think/Route.php index 804b7ead..db6f4748 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -1061,9 +1061,13 @@ class Route private static function parseUrlParams($url, $var) { if ($url) { - preg_replace_callback('/(\w+)\/([^\/]+)/', function ($match) use (&$var) { - $var[strtolower($match[1])] = strip_tags($match[2]); - }, $url); + if (Config::get('url_param_type')) { + $var += explode('/', $url); + } else { + preg_replace_callback('/(\w+)\/([^\/]+)/', function ($match) use (&$var) { + $var[strtolower($match[1])] = strip_tags($match[2]); + }, $url); + } } $_GET = array_merge($var, $_GET); }