From: Timo Tijhof Date: Thu, 14 Feb 2013 09:55:36 +0000 (+0100) Subject: InfoAction: Heading ID should not include # character. X-Git-Tag: 1.31.0-rc.0~20698^2 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=e4e67ed6556f5f6efb297b1eafca8b09a3d45a41;p=lhc%2Fweb%2Fwiklou.git InfoAction: Heading ID should not include # character. It was using Parser::guessSectionNameFromWikiText, which expects a string of wikitext (e.g. "== Foo ==") and extracts the heading text, and from that it generates an ID, and from that it generates an anchor link. The extraction and anchor link are wrong and caused the output to be

instead of

. Follows up I702f2f13. Bug: 44989 Change-Id: I81f67ae1ac86ed709c69f1bced970b2cbb5138db --- diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php index acb8c00fe7..ebedde3003 100644 --- a/includes/actions/InfoAction.php +++ b/includes/actions/InfoAction.php @@ -125,8 +125,7 @@ class InfoAction extends FormlessAction { * @return string The HTML. */ protected function makeHeader( $header ) { - global $wgParser; - $spanAttribs = array( 'class' => 'mw-headline', 'id' => $wgParser->guessSectionNameFromWikiText( $header ) ); + $spanAttribs = array( 'class' => 'mw-headline', 'id' => Sanitizer::escapeId( $header ) ); return Html::rawElement( 'h2', array(), Html::element( 'span', $spanAttribs, $header ) ); }