From: Roan Kattouw Date: Wed, 22 Nov 2017 23:11:50 +0000 (-0500) Subject: Linker: Use Parser::guessSectionNameFromStrippedText() X-Git-Tag: 1.31.0-rc.0~1225^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=62f284a6acd215a9f6bc8837eb5a9cbddd2f2743 Linker: Use Parser::guessSectionNameFromStrippedText() Instead of weird partial stuff. Change-Id: Ibe7435a4723d2741e32d37d2ba67396d78d14044 --- diff --git a/includes/Linker.php b/includes/Linker.php index 403b10a149..17bcc91a83 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1170,12 +1170,12 @@ class Linker { $section = str_replace( '[[', '', $section ); $section = str_replace( ']]', '', $section ); - $section = Sanitizer::normalizeSectionNameWhitespace( $section ); # T24784 + $section = substr( Parser::guessSectionNameFromStrippedText( $section ), 1 ); if ( $local ) { - $sectionTitle = Title::newFromText( '#' . $section ); + $sectionTitle = Title::makeTitleSafe( NS_MAIN, '', $section ); } else { $sectionTitle = Title::makeTitleSafe( $title->getNamespace(), - $title->getDBkey(), Sanitizer::decodeCharReferences( $section ) ); + $title->getDBkey(), $section ); } if ( $sectionTitle ) { $link = Linker::makeCommentLink( $sectionTitle, $wgLang->getArrow(), $wikiId, 'noclasses' );