From 541acecb6a64c2beacdefbe8a9be08c13090c582 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 10 Jan 2016 16:55:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Url.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/think/Url.php b/library/think/Url.php index 3d308a52..8be23126 100644 --- a/library/think/Url.php +++ b/library/think/Url.php @@ -46,12 +46,12 @@ class Url $url = $aliasUrl; } else { // 检测路由 - if (!$match = Cache::get(md5($url))) { + if (false === $match = Cache::get(md5($url))) { // 没有检测过 重新检测 $match = self::checkRoute($url, $vars); - Cache::set(md5($url), $match); + Cache::set(md5($url), empty($match) ? '' : $match); } - if (is_null($match)) { + if (!$match) { // 路由不存在 直接解析 if (false !== strpos($url, '\\')) { // 解析到类 @@ -177,7 +177,7 @@ class Url } } } - return null; + return false; } // 检测变量规则