Merge "ApiFeedWatchlist: Use guessSectionNameFromWikiText()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 8 Dec 2017 18:50:35 +0000 (18:50 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 8 Dec 2017 18:50:36 +0000 (18:50 +0000)
includes/api/ApiFeedWatchlist.php

index e3a757f..db15032 100644 (file)
@@ -215,10 +215,7 @@ class ApiFeedWatchlist extends ApiBase {
                        preg_match( '!(.*)/\*\s*(.*?)\s*\*/(.*)!', $comment, $matches )
                ) {
                        global $wgParser;
-
-                       $sectionTitle = $wgParser->stripSectionName( $matches[2] );
-                       $sectionTitle = Sanitizer::normalizeSectionNameWhitespace( $sectionTitle );
-                       $titleUrl .= Title::newFromText( '#' . $sectionTitle )->getFragmentForURL();
+                       $titleUrl .= $wgParser->guessSectionNameFromWikiText( $matches[ 2 ] );
                }
 
                $timestamp = $info['timestamp'];