Commit 5fc3733f by Alexander Makarov

Merge pull request #3843 from umneeq/yii-widgets-menu-fix

Fix Menu bug when using `template` with `encodeLabel` => false
parents b9db070a c3cde232
...@@ -48,6 +48,7 @@ Yii Framework 2 Change Log ...@@ -48,6 +48,7 @@ Yii Framework 2 Change Log
- 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) - Bug: URL encoding for the route parameter added to `\yii\web\UrlManager` (klimov-paul)
- Bug: Fixed the bug that requesting protected or private action methods would cause 500 error instead of 404 (qiangxue) - Bug: Fixed the bug that requesting protected or private action methods would cause 500 error instead of 404 (qiangxue)
- Bug #3843: Fixed Menu bug when using `template` with `encodeLabel` => false (creocoder, umneeq)
- 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)
......
...@@ -255,9 +255,7 @@ class Menu extends Widget ...@@ -255,9 +255,7 @@ class Menu extends Widget
if (!isset($item['label'])) { if (!isset($item['label'])) {
$item['label'] = ''; $item['label'] = '';
} }
if ($this->encodeLabels) { $items[$i]['label'] = $this->encodeLabels ? Html::encode($item['label']) : $item['label'];
$items[$i]['label'] = Html::encode($item['label']);
}
$hasActiveChild = false; $hasActiveChild = false;
if (isset($item['items'])) { if (isset($item['items'])) {
$items[$i]['items'] = $this->normalizeItems($item['items'], $hasActiveChild); $items[$i]['items'] = $this->normalizeItems($item['items'], $hasActiveChild);
......
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