From fdb5a966ed1b330ae0357cb670c0ad57957fbc26 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 10 Aug 2017 12:25:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=B7=AF=E7=94=B1=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E6=B3=A8=E5=86=8C=E7=9A=84=E4=B8=80=E4=B8=AABUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Route.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/think/Route.php b/library/think/Route.php index 2046570a..5f9f2a88 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -255,9 +255,11 @@ class Route $option1 = array_merge($option, $val[1]); $pattern1 = array_merge($pattern, isset($val[2]) ? $val[2] : []); } else { - $route = $val; + $option1 = null; + $pattern1 = null; + $route = $val; } - self::setRule($key, $route, $type, isset($option1) ? $option1 : $option, isset($pattern1) ? $pattern1 : $pattern, $group); + self::setRule($key, $route, $type, !is_null($option1) ? $option1 : $option, !is_null($pattern1) ? $pattern1 : $pattern, $group); } } else { self::setRule($rule, $route, $type, $option, $pattern, $group);