From 45ced4dfef5a1997aa4d0135e25fb93679465ad2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Mon, 3 Sep 2018 22:08:11 +0200 Subject: [PATCH] EditWatchlistNormalHTMLForm: Fix double-escaping of section legends 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 | 2 +- includes/specials/forms/EditWatchlistNormalHTMLForm.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/htmlform/HTMLForm.php b/includes/htmlform/HTMLForm.php index 9a78fd843b..52a18eb7b8 100644 --- a/includes/htmlform/HTMLForm.php +++ b/includes/htmlform/HTMLForm.php @@ -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(); diff --git a/includes/specials/forms/EditWatchlistNormalHTMLForm.php b/includes/specials/forms/EditWatchlistNormalHTMLForm.php index 5f07073593..78b0335534 100644 --- a/includes/specials/forms/EditWatchlistNormalHTMLForm.php +++ b/includes/specials/forms/EditWatchlistNormalHTMLForm.php @@ -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( -- 2.20.1