Skip to content

Commit

Permalink
改进
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Dec 11, 2018
1 parent 83333bb commit adde39c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/think/route/dispatch/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected function parseUrl($url)
$controller = !empty($path) ? array_shift($path) : null;
}

if (!preg_match('/^[A-Za-z](\w|\.)*$/', $controller)) {
if ($controller && !preg_match('/^[A-Za-z](\w|\.)*$/', $controller)) {
throw new HttpException(404, 'controller not exists:' . $controller);
}

Expand Down

0 comments on commit adde39c

Please sign in to comment.