From: Roan Kattouw Date: Wed, 22 Nov 2017 22:31:34 +0000 (-0500) Subject: SpecialListgrouprights: Fix "Namespace restrictions" header ID X-Git-Tag: 1.31.0-rc.0~1224^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/categories/modifier.php?a=commitdiff_plain;h=f0aa0b7db3b81788cb398450581ecb0cd42fa896;p=lhc%2Fweb%2Fwiklou.git 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 --- 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(