Skip to content

Commit a1b8703

Browse files
committedNov 30, 2020
Make url params case sensitive
1 parent da426cc commit a1b8703

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎src/Router.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,12 @@ public function getController(\Swoole\Http\Response $response): Controller {
113113
$par[] = array_pop($action);
114114
continue;
115115
}
116-
$classname = '\\Controller\\' . strtolower(implode('\\', $action)) . '\\' . $this->method . $v;
116+
$classname = '\\Controller\\' . (empty($action) ? '' : strtolower(implode('\\', $action)) . '\\') .
117+
$this->method . $v;
117118
$class_exists = class_exists($classname, false);
118119
if (! $class_exists) {
119-
$file_name = Environment::getDir()->controller . strtolower(implode('/', $action)) . '/' .
120-
$this->method . $v . '.php';
120+
$file_name = Environment::getDir()->controller .
121+
(empty($action) ? '' : strtolower(implode('/', $action)) . '/') . $this->method . $v . '.php';
121122
if (file_exists($file_name)) {
122123
require_once $file_name;
123124
$class_exists = class_exists($classname, false);

0 commit comments

Comments
 (0)
Please sign in to comment.