From: Bartosz DziewoƄski Date: Wed, 4 Nov 2015 00:15:29 +0000 (+0100) Subject: HTMLFormField: Do not double-escape label in OOUI mode X-Git-Tag: 1.31.0-rc.0~9104^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/gestion/rappel_supprimer.php?a=commitdiff_plain;h=acd2ac33138ea9865b2672cc3c7c751c45fc7cfd;p=lhc%2Fweb%2Fwiklou.git 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 --- 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;