From 99f534d8fc89916d3a7f8e80a177e8ee59b9c268 Mon Sep 17 00:00:00 2001 From: maxlun Date: Tue, 13 Aug 2013 02:40:27 +0400 Subject: [PATCH] Fix of bug, that multi-word names of controllers and actions don't work: AdminProductController, actionItemsActive. --- framework/yii/base/Controller.php | 2 +- framework/yii/base/Module.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/yii/base/Controller.php b/framework/yii/base/Controller.php index 5289b5bcdfd..9352383777d 100644 --- a/framework/yii/base/Controller.php +++ b/framework/yii/base/Controller.php @@ -185,7 +185,7 @@ public function createAction($id) $actionMap = $this->actions(); if (isset($actionMap[$id])) { return Yii::createObject($actionMap[$id], $id, $this); - } elseif (preg_match('/^[a-z0-9\\-_]+$/', $id)) { + } elseif (preg_match('/^[a-z0-9A-Z\\-_]+$/', $id)) { $methodName = 'action' . str_replace(' ', '', ucwords(implode(' ', explode('-', $id)))); if (method_exists($this, $methodName)) { $method = new \ReflectionMethod($this, $methodName); diff --git a/framework/yii/base/Module.php b/framework/yii/base/Module.php index a85385bbd5b..fba3f5113ff 100644 --- a/framework/yii/base/Module.php +++ b/framework/yii/base/Module.php @@ -614,7 +614,7 @@ public function createController($route) if (isset($this->controllerMap[$id])) { $controller = Yii::createObject($this->controllerMap[$id], $id, $this); - } elseif (preg_match('/^[a-z0-9\\-_]+$/', $id)) { + } elseif (preg_match('/^[a-z0-9A-Z\\-_]+$/', $id)) { $className = str_replace(' ', '', ucwords(implode(' ', explode('-', $id)))) . 'Controller'; $classFile = $this->controllerPath . DIRECTORY_SEPARATOR . $className . '.php'; if (!is_file($classFile)) {