Commit 6c0dde6f by Qiang Xue

Fixes #5143: yii\bootstrap\ActiveField::label() should not encode label if it is…

Fixes #5143: yii\bootstrap\ActiveField::label() should not encode label if it is explicitly specified. [skip ci]
parent 982a27db
...@@ -373,11 +373,11 @@ class ActiveField extends \yii\widgets\ActiveField ...@@ -373,11 +373,11 @@ class ActiveField extends \yii\widgets\ActiveField
unset($options['label']); unset($options['label']);
} else { } else {
$attribute = Html::getAttributeName($this->attribute); $attribute = Html::getAttributeName($this->attribute);
$label = $this->model->getAttributeLabel($attribute); $label = Html::encode($this->model->getAttributeLabel($attribute));
} }
} }
$this->parts['{beginLabel}'] = Html::beginTag('label', $options); $this->parts['{beginLabel}'] = Html::beginTag('label', $options);
$this->parts['{endLabel}'] = Html::endTag('label'); $this->parts['{endLabel}'] = Html::endTag('label');
$this->parts['{labelTitle}'] = Html::encode($label); $this->parts['{labelTitle}'] = $label;
} }
} }
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