From acd2ac33138ea9865b2672cc3c7c751c45fc7cfd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Wed, 4 Nov 2015 01:15:29 +0100 Subject: [PATCH] HTMLFormField: Do not double-escape label in OOUI mode $this->getLabel() returns already parsed HTML. Who'd have thought? https://www.wikidata.org/wiki/Wikidata:Contact_the_development_team#Display_issue_on_Special:NewItem Change-Id: I52aa9b78fde27d4a16b3636fa6b70d3c69ff2346 --- includes/htmlform/HTMLFormField.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/htmlform/HTMLFormField.php b/includes/htmlform/HTMLFormField.php index 20d7250f36..2e3fdb0ccf 100644 --- a/includes/htmlform/HTMLFormField.php +++ b/includes/htmlform/HTMLFormField.php @@ -11,7 +11,7 @@ abstract class HTMLFormField { protected $mFilterCallback; protected $mName; protected $mDir; - protected $mLabel; # String label. Set on construction + protected $mLabel; # String label, as HTML. Set on construction. protected $mID; protected $mClass = ''; protected $mVFormClass = ''; @@ -601,7 +601,7 @@ abstract class HTMLFormField { $config = array( 'classes' => array( "mw-htmlform-field-$fieldType", $this->mClass ), 'align' => $this->getLabelAlignOOUI(), - 'label' => $this->getLabel(), + 'label' => new OOUI\HtmlSnippet( $this->getLabel() ), 'help' => $helpText !== null ? new OOUI\HtmlSnippet( $helpText ) : null, 'errors' => $errors, 'infusable' => $infusable, @@ -837,7 +837,7 @@ abstract class HTMLFormField { } /** - * @return string + * @return string HTML */ function getLabel() { return is_null( $this->mLabel ) ? '' : $this->mLabel; -- 2.20.1