From b797d72352e6b4eb0e11b6bc2a2ef25907b7756f Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 9 Dec 2018 20:15:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E6=8E=A7=E5=88=B6=E5=99=A8?= =?UTF-8?q?=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/App.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/think/App.php b/library/think/App.php index 3c5f81f0..297f8ae5 100644 --- a/library/think/App.php +++ b/library/think/App.php @@ -551,6 +551,11 @@ class App // 获取控制器名 $controller = strip_tags($result[1] ?: $config['default_controller']); + + if (!preg_match('/^[A-Za-z](\w)*$/', $controller)) { + throw new HttpException(404, 'controller not exists:' . $controller); + } + $controller = $convert ? strtolower($controller) : $controller; // 获取操作名