Permalink
Browse files

控制器检测调整到UrlDispatcher

  • Loading branch information...
liu21st committed Dec 10, 2018
1 parent 93339b1 commit b4b3e90098143894c7da3a24bdff8a9b95ab29ec
Showing with 4 additions and 4 deletions.
  1. +0 −4 library/think/route/dispatch/Module.php
  2. +4 −0 library/think/route/dispatch/Url.php
@@ -69,10 +69,6 @@ public function init()
// 获取控制器名
$controller = strip_tags($result[1] ?: $this->rule->getConfig('default_controller'));
if (!preg_match('/^[A-Za-z](\w|\.)*$/', $controller)) {
throw new HttpException(404, 'controller not exists:' . $controller);
}
$this->controller = $convert ? strtolower($controller) : $controller;
// 获取操作名
@@ -60,6 +60,10 @@ protected function parseUrl($url)
$controller = !empty($path) ? array_shift($path) : null;
}
if (!preg_match('/^[A-Za-z](\w|\.)*$/', $controller)) {
throw new HttpException(404, 'controller not exists:' . $controller);
}
// 解析操作
$action = !empty($path) ? array_shift($path) : null;

0 comments on commit b4b3e90

Please sign in to comment.