From 714eb8f1b71c3afd9239c800d7bc4169d98cb90d Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 22 Aug 2016 15:54:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E8=B7=AF=E7=94=B1=E5=88=86?= =?UTF-8?q?=E7=BB=84=E7=9A=84URL=E5=8C=B9=E9=85=8D=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Route.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/think/Route.php b/library/think/Route.php index 4e83a340..63da7850 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -871,12 +871,13 @@ class Route if (is_array($rule)) { // 分组路由 - if (($pos = strpos($key, ':')) || ($pos = strpos($key, '<'))) { + $pos = strpos(str_replace('<', ':', $key), ':'); + if (false !== $pos) { $str = substr($key, 0, $pos); } else { $str = $key; } - if (is_string($str) && 0 !== strpos($url, $str)) { + if (is_string($str) && $str && 0 !== strpos($url, $str)) { continue; }