From: Roan Kattouw Date: Wed, 22 Nov 2017 23:03:14 +0000 (-0500) Subject: ApiFeedWatchlist: Use guessSectionNameFromWikiText() X-Git-Tag: 1.31.0-rc.0~1226^2~1 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=4dbb6b2d778ec98bcf7b8de8f908ac5db8459c49;hp=b72c4df18b00b3948f0319fa5b01f969e1b92dbd;p=lhc%2Fweb%2Fwiklou.git ApiFeedWatchlist: Use guessSectionNameFromWikiText() Instead of reimplementing almost all of it by scraping it together from various sources. Change-Id: I22f0020e65e4c6c09edf030ae35fdee5bdaaf7bc --- diff --git a/includes/api/ApiFeedWatchlist.php b/includes/api/ApiFeedWatchlist.php index e3a757f79a..db150323f9 100644 --- a/includes/api/ApiFeedWatchlist.php +++ b/includes/api/ApiFeedWatchlist.php @@ -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'];