Commit 79f9f85f by Alexander Makarov

Fixes #4024, Fixes #4028

parent dde695cd
...@@ -138,7 +138,7 @@ class Tabs extends Widget ...@@ -138,7 +138,7 @@ class Tabs extends Widget
if (!isset($item['label'])) { if (!isset($item['label'])) {
throw new InvalidConfigException("The 'label' option is required."); throw new InvalidConfigException("The 'label' option is required.");
} }
$encodeLabel = $this->encodeLabels || isset($item['encode']) && $item['encode'] === true; $encodeLabel = isset($item['encode']) ? $item['encode'] : $this->encodeLabels;
$label = $encodeLabel ? Html::encode($item['label']) : $item['label']; $label = $encodeLabel ? Html::encode($item['label']) : $item['label'];
$headerOptions = array_merge($this->headerOptions, ArrayHelper::getValue($item, 'headerOptions', [])); $headerOptions = array_merge($this->headerOptions, ArrayHelper::getValue($item, 'headerOptions', []));
$linkOptions = array_merge($this->linkOptions, ArrayHelper::getValue($item, 'linkOptions', [])); $linkOptions = array_merge($this->linkOptions, ArrayHelper::getValue($item, 'linkOptions', []));
......
...@@ -257,7 +257,7 @@ class Menu extends Widget ...@@ -257,7 +257,7 @@ class Menu extends Widget
if (!isset($item['label'])) { if (!isset($item['label'])) {
$item['label'] = ''; $item['label'] = '';
} }
$encodeLabel = $this->encodeLabels || isset($item['encode']) && $item['encode'] === true; $encodeLabel = isset($item['encode']) ? $item['encode'] : $this->encodeLabels;
$items[$i]['label'] = $encodeLabel ? Html::encode($item['label']) : $item['label']; $items[$i]['label'] = $encodeLabel ? Html::encode($item['label']) : $item['label'];
$hasActiveChild = false; $hasActiveChild = false;
if (isset($item['items'])) { if (isset($item['items'])) {
......
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