From 0818550b9a25869da4714489bec2d57d2999244d Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 2 Aug 2016 10:25:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Route.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/think/Route.php b/library/think/Route.php index 676b3fbf..cf019f44 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -343,8 +343,8 @@ class Route } if (!empty($name)) { if ($routes instanceof \Closure) { - $currentOption = self::getGroup('option'); - $currentPattern = self::getGroup('pattern'); + $currentOption = self::getGroup('option') ?: []; + $currentPattern = self::getGroup('pattern') ?: []; self::setGroup($name, array_merge($currentOption, $option), array_merge($currentPattern, $pattern)); call_user_func_array($routes, []); self::setGroup($currentGroup, $currentOption, $currentPattern); @@ -383,8 +383,8 @@ class Route } elseif ($routes instanceof \Closure) { // 闭包注册 - $currentOption = self::getGroup('option'); - $currentPattern = self::getGroup('pattern'); + $currentOption = self::getGroup('option') ?: []; + $currentPattern = self::getGroup('pattern') ?: []; self::setGroup('', array_merge($currentOption, $option), array_merge($currentPattern, $pattern)); call_user_func_array($routes, []); self::setGroup($currentGroup, $currentOption, $currentPattern);