HTMLForm: fix double escaping of checkbox labels in vform
authorPcoombe <pcoombe@wikimedia.org>
Tue, 15 Apr 2014 14:58:51 +0000 (15:58 +0100)
committerIAlex <codereview@emsenhuber.ch>
Sun, 25 May 2014 14:55:02 +0000 (14:55 +0000)
mLabel has already been escaped if required. It isn't run through htmlspecialchars()
in other display formats, so doesn't need to be done in vform.

Change-Id: I0b0feec408687cdadf01da5f2078980015538bb7

includes/htmlform/HTMLCheckField.php [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index c7ec014..a0dd370
@@ -24,8 +24,7 @@ class HTMLCheckField extends HTMLFormField {
                                array(
                                        'class' => 'mw-ui-checkbox-label'
                                ),
-                               Xml::check( $this->mName, $value, $attr ) . // Html:rawElement doesn't escape contents.
-                               htmlspecialchars( $this->mLabel ) );
+                               Xml::check( $this->mName, $value, $attr ) . $this->mLabel );
                } else {
                        return Xml::check( $this->mName, $value, $attr )
                        . '&#160;'