From f0aa0b7db3b81788cb398450581ecb0cd42fa896 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Wed, 22 Nov 2017 17:31:34 -0500 Subject: [PATCH] SpecialListgrouprights: Fix "Namespace restrictions" header ID * Strip the '#' from the start of the

's id attribute * Don't parse the header message. It doesn't contain HTML, and it's used as plain text anyway. * Use guessSectionNameFromStrippedText() because we are now feeding it plain text. Previously we were calling guessSectionNameFromWikitext() but passing in HTML. Change-Id: I380c20293437dbcd3419f83ea8b7a7ee0bb504f1 --- includes/specials/SpecialListgrouprights.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/specials/SpecialListgrouprights.php b/includes/specials/SpecialListgrouprights.php index 2315887aa5..a299933ac0 100644 --- a/includes/specials/SpecialListgrouprights.php +++ b/includes/specials/SpecialListgrouprights.php @@ -141,7 +141,7 @@ class SpecialListGroupRights extends SpecialPage { } private function outputNamespaceProtectionInfo() { - global $wgParser, $wgContLang; + global $wgContLang; $out = $this->getOutput(); $namespaceProtection = $this->getConfig()->get( 'NamespaceProtection' ); @@ -149,11 +149,11 @@ class SpecialListGroupRights extends SpecialPage { return; } - $header = $this->msg( 'listgrouprights-namespaceprotection-header' )->parse(); + $header = $this->msg( 'listgrouprights-namespaceprotection-header' )->text(); $out->addHTML( Html::rawElement( 'h2', [], Html::element( 'span', [ 'class' => 'mw-headline', - 'id' => $wgParser->guessSectionNameFromWikiText( $header ) + 'id' => substr( Parser::guessSectionNameFromStrippedText( $header ), 1 ) ], $header ) ) . Xml::openElement( 'table', [ 'class' => 'wikitable' ] ) . Html::element( -- 2.20.1