mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-16 22:39:52 +08:00
Fixes issue #320: Module::createController() will fail with a route with trailing slash.
This commit is contained in:
@@ -592,6 +592,7 @@ abstract class Module extends Component
|
|||||||
if ($route === '') {
|
if ($route === '') {
|
||||||
$route = $this->defaultRoute;
|
$route = $this->defaultRoute;
|
||||||
}
|
}
|
||||||
|
$route = trim($route, '/');
|
||||||
if (($pos = strpos($route, '/')) !== false) {
|
if (($pos = strpos($route, '/')) !== false) {
|
||||||
$id = substr($route, 0, $pos);
|
$id = substr($route, 0, $pos);
|
||||||
$route = substr($route, $pos + 1);
|
$route = substr($route, $pos + 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user