From a153750efe000403bb055b154ef8ca38fb2b80b9 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Fri, 24 Oct 2014 08:01:35 -0400 Subject: [PATCH] Fixes #5745: Gii and debug modules may cause 404 exception when the route contains dashes --- extensions/debug/CHANGELOG.md | 1 + extensions/debug/Module.php | 2 +- extensions/gii/CHANGELOG.md | 3 ++- extensions/gii/Module.php | 2 +- framework/CHANGELOG.md | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/extensions/debug/CHANGELOG.md b/extensions/debug/CHANGELOG.md index 42d054e33b..26c59c6390 100644 --- a/extensions/debug/CHANGELOG.md +++ b/extensions/debug/CHANGELOG.md @@ -5,6 +5,7 @@ Yii Framework 2 debug extension Change Log ----------------------- - Bug #5402: Debugger was not loading when there were closures in asset classes (samdark) +- Bug #5745: Gii and debug modules may cause 404 exception when the route contains dashes (qiangxue) - Enh #5600: Allow configuring debug panels in `yii\debug\Module::panels` as panel class name strings (qiangxue) diff --git a/extensions/debug/Module.php b/extensions/debug/Module.php index 709d2d3254..3a6fa09b85 100644 --- a/extensions/debug/Module.php +++ b/extensions/debug/Module.php @@ -124,7 +124,7 @@ class Module extends \yii\base\Module implements BootstrapInterface $app->getUrlManager()->addRules([ $this->id => $this->id, - $this->id . '//' => $this->id . '//', + $this->id . '//' => $this->id . '//', ], false); } diff --git a/extensions/gii/CHANGELOG.md b/extensions/gii/CHANGELOG.md index d990a33957..de0e2488f4 100644 --- a/extensions/gii/CHANGELOG.md +++ b/extensions/gii/CHANGELOG.md @@ -4,8 +4,9 @@ Yii Framework 2 gii extension Change Log 2.0.1 under development ----------------------- -- Enh #5613: Added `--overwrite` option to Gii console command to support overwriting all files (motin, qiangxue) +- Bug #5745: Gii and debug modules may cause 404 exception when the route contains dashes (qiangxue) - Bug: Gii console command help information does not contain global options (qiangxue) +- Enh #5613: Added `--overwrite` option to Gii console command to support overwriting all files (motin, qiangxue) 2.0.0 October 12, 2014 diff --git a/extensions/gii/Module.php b/extensions/gii/Module.php index 116ba64b75..359a8d4a3d 100644 --- a/extensions/gii/Module.php +++ b/extensions/gii/Module.php @@ -88,7 +88,7 @@ class Module extends \yii\base\Module implements BootstrapInterface $app->getUrlManager()->addRules([ $this->id => $this->id . '/default/index', $this->id . '/' => $this->id . '/default/view', - $this->id . '//' => $this->id . '//', + $this->id . '//' => $this->id . '//', ], false); } elseif ($app instanceof \yii\console\Application) { $app->controllerMap[$this->id] = [ diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index aaa770a1f6..9bfbace9f8 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -13,6 +13,7 @@ Yii Framework 2 Change Log - Bug #5665: The `currentPage` meta data in the RESTful result should be 1-based, similar to that in HTTP headers (qiangxue) - Bug #5682: The `asset` command would incorrectly combine CSS files when `UrlManager::linkAssets` is true (dmvslv) - Bug #5702: Parenthesis should be automatically added to `Validator::whenClient` to avoid js error (mdmunir, qiangxue) +- Bug #5745: Gii and debug modules may cause 404 exception when the route contains dashes (qiangxue) - Bug: Gii console command help information does not contain global options (qiangxue) - Bug: `yii\web\UrlRule` was unable to create URLs for rules containing unicode characters (samdark) - Enh #5223: Query builder now supports selecting sub-queries as columns (qiangxue)