EditWatchlistNormalHTMLForm: Fix double-escaping of section legends
authorBartosz Dziewoński <matma.rex@gmail.com>
Mon, 3 Sep 2018 20:08:11 +0000 (22:08 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Mon, 3 Sep 2018 20:09:13 +0000 (22:09 +0200)
Parent getLegend() returns a plain string, and this method should
do the same.

Form section legends are escaped by the wrapFieldSetSection() method.

Change-Id: I2059b9182fba7362f3d6226252bdc3e032a06c57

includes/htmlform/HTMLForm.php
includes/specials/forms/EditWatchlistNormalHTMLForm.php

index 9a78fd8..52a18eb 100644 (file)
@@ -1833,7 +1833,7 @@ class HTMLForm extends ContextSource {
         *
         * @param string $key
         *
-        * @return string
+        * @return string Plain text (not HTML-escaped)
         */
        public function getLegend( $key ) {
                return $this->msg( "{$this->mMessagePrefix}-$key" )->text();
index 5f07073..78b0335 100644 (file)
@@ -26,8 +26,8 @@ class EditWatchlistNormalHTMLForm extends OOUIHTMLForm {
                $namespace = substr( $namespace, 2 );
 
                return $namespace == NS_MAIN
-                       ? $this->msg( 'blanknamespace' )->escaped()
-                       : htmlspecialchars( $this->getContext()->getLanguage()->getFormattedNsText( $namespace ) );
+                       ? $this->msg( 'blanknamespace' )->text()
+                       : $this->getContext()->getLanguage()->getFormattedNsText( $namespace );
        }
 
        public function displaySection(