Commit c51b9956 by Carsten Brandt

Merge pull request #3614 from klimov-paul/route-url-encode

Route parameter url encoding added
parents 984bb987 0267d55c
...@@ -36,6 +36,7 @@ Yii Framework 2 Change Log ...@@ -36,6 +36,7 @@ Yii Framework 2 Change Log
- Bug #3578: Fixed postgreSQL column type detection, added missing types (MDMunir, cebe) - Bug #3578: Fixed postgreSQL column type detection, added missing types (MDMunir, cebe)
- Bug #3591: Fix incomplete obsolete filling in i18n `MessageController::saveMessagesToDb()` (advsm) - Bug #3591: Fix incomplete obsolete filling in i18n `MessageController::saveMessagesToDb()` (advsm)
- Bug: Fixed inconsistent return of `\yii\console\Application::runAction()` (samdark) - 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 #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 #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) - Enh #2837: Error page now shows arguments in stack trace method calls (samdark)
......
...@@ -325,7 +325,7 @@ class UrlManager extends Component ...@@ -325,7 +325,7 @@ class UrlManager extends Component
return "$baseUrl/{$route}{$anchor}"; return "$baseUrl/{$route}{$anchor}";
} else { } else {
$url = "$baseUrl?{$this->routeParam}=$route"; $url = "$baseUrl?{$this->routeParam}=" . urlencode($route);
if (!empty($params) && ($query = http_build_query($params)) !== '') { if (!empty($params) && ($query = http_build_query($params)) !== '') {
$url .= '&' . $query; $url .= '&' . $query;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment