From 323008b177e5e1606cf50d401f24dd4f9db7c7d7 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Fri, 29 Nov 2013 12:31:09 -0500 Subject: [PATCH] Fixes #1296: stricter check of dashes in route. --- framework/yii/base/Controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/yii/base/Controller.php b/framework/yii/base/Controller.php index 72eb0c8..d14c9dd 100644 --- a/framework/yii/base/Controller.php +++ b/framework/yii/base/Controller.php @@ -194,7 +194,7 @@ class Controller extends Component implements ViewContextInterface $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-9\\-_]+$/', $id) && strpos($id, '--') === false && trim($id, '-') === $id) { $methodName = 'action' . str_replace(' ', '', ucwords(implode(' ', explode('-', $id)))); if (method_exists($this, $methodName)) { $method = new \ReflectionMethod($this, $methodName);