From 210cbda732ea3e7597fdec07e64cba81b62ccc49 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Sat, 23 Nov 2013 23:05:06 -0500 Subject: [PATCH] Fixes #1296: stricter check of dashes in route. --- framework/yii/base/Module.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/yii/base/Module.php b/framework/yii/base/Module.php index 1e5302c..3ca3aa2 100644 --- a/framework/yii/base/Module.php +++ b/framework/yii/base/Module.php @@ -623,7 +623,7 @@ abstract class Module extends Component 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-9\\-_]+$/', $id) && strpos($id, '--') === false && trim($id, '-') === $id) { $className = str_replace(' ', '', ucwords(str_replace('-', ' ', $id))) . 'Controller'; $classFile = $this->controllerPath . DIRECTORY_SEPARATOR . $className . '.php'; if (!is_file($classFile)) {