We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c2b06e commit 802f284Copy full SHA for 802f284
library/think/route/dispatch/Module.php
@@ -67,7 +67,12 @@ public function init()
67
// 是否自动转换控制器和操作名
68
$convert = is_bool($this->convert) ? $this->convert : $this->rule->getConfig('url_convert');
69
// 获取控制器名
70
- $controller = strip_tags($result[1] ?: $this->rule->getConfig('default_controller'));
+ $controller = strip_tags($result[1] ?: $this->rule->getConfig('default_controller'));
71
+
72
+ if (!preg_match('/^[A-Za-z](\w)*$/', $controller)) {
73
+ throw new HttpException(404, 'controller not exists:' . $controller);
74
+ }
75
76
$this->controller = $convert ? strtolower($controller) : $controller;
77
78
// 获取操作名
0 commit comments