diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index aa6fb7b304..e69ad024a6 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -36,6 +36,7 @@ Yii Framework 2 Change Log - Bug #3578: Fixed postgreSQL column type detection, added missing types (MDMunir, cebe) - Bug #3591: Fix incomplete obsolete filling in i18n `MessageController::saveMessagesToDb()` (advsm) - Bug: Fixed inconsistent return of `\yii\console\Application::runAction()` (samdark) +- Bug: URL encoding for the route parameter added to `\yii\web\UrlManager` (klimov-paul) - Enh #2264: `CookieCollection::has()` will return false for expired or removed cookies (qiangxue) - Enh #2435: `yii\db\IntegrityException` is now thrown on database integrity errors instead of general `yii\db\Exception` (samdark) - Enh #2837: Error page now shows arguments in stack trace method calls (samdark) diff --git a/framework/web/UrlManager.php b/framework/web/UrlManager.php index 968ba21578..50b89ea41f 100644 --- a/framework/web/UrlManager.php +++ b/framework/web/UrlManager.php @@ -325,7 +325,7 @@ class UrlManager extends Component return "$baseUrl/{$route}{$anchor}"; } else { - $url = "$baseUrl?{$this->routeParam}=$route"; + $url = "$baseUrl?{$this->routeParam}=" . urlencode($route); if (!empty($params) && ($query = http_build_query($params)) !== '') { $url .= '&' . $query; }