Avoid double escaping headers in InfoAction
[lhc/web/wiklou.git] / includes / actions / InfoAction.php
index baec944..62f7ddf 100644 (file)
@@ -128,7 +128,7 @@ class InfoAction extends FormlessAction {
                        // pageinfo-header-basic, pageinfo-header-edits, pageinfo-header-restrictions,
                        // pageinfo-header-properties, pageinfo-category-info
                        $content .= $this->makeHeader(
-                               $this->msg( "pageinfo-${header}" )->escaped(),
+                               $this->msg( "pageinfo-${header}" )->text(),
                                "mw-pageinfo-${header}"
                        ) . "\n";
                        $table = "\n";
@@ -153,11 +153,12 @@ class InfoAction extends FormlessAction {
         * Creates a header that can be added to the output.
         *
         * @param string $header The header text.
+        * @param string $canonicalId
         * @return string The HTML.
         */
        protected function makeHeader( $header, $canonicalId ) {
-               $spanAttribs = [ 'class' => 'mw-headline', 'id' => Sanitizer::escapeId( $header ) ];
-               $h2Attribs = [ 'id' => Sanitizer::escapeId( $canonicalId ) ];
+               $spanAttribs = [ 'class' => 'mw-headline', 'id' => Sanitizer::escapeIdForAttribute( $header ) ];
+               $h2Attribs = [ 'id' => Sanitizer::escapeIdForAttribute( $canonicalId ) ];
 
                return Html::rawElement( 'h2', $h2Attribs, Html::element( 'span', $spanAttribs, $header ) );
        }
@@ -848,7 +849,7 @@ class InfoAction extends FormlessAction {
                $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
 
                # Sift for real versus user names
-               /** @var $user User */
+               /** @var User $user */
                foreach ( $contributors as $user ) {
                        $page = $user->isAnon()
                                ? SpecialPage::getTitleFor( 'Contributions', $user->getName() )