Merge "Fix links to sections with [[links]] in their title"

This commit is contained in:
jenkins-bot 2016-09-27 19:53:33 +00:00 committed by Gerrit Code Review
commit faf3bee07c

View file

@ -45,13 +45,16 @@ trait EchoPresentationModelSectionTrait {
* @return Title
*/
protected function getTitleWithSection() {
global $wgParser;
$title = $this->event->getTitle();
$section = $this->getSection();
// guessSectionNameFromWikiText() returns '#foo', strip the '#'
$fragment = substr( $wgParser->guessSectionNameFromWikiText( $section ), 1 );
if ( $section ) {
$title = Title::makeTitle(
$title->getNamespace(),
$title->getDBkey(),
$section
$fragment
);
}
return $title;