From 4dbb6b2d778ec98bcf7b8de8f908ac5db8459c49 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Wed, 22 Nov 2017 18:03:14 -0500 Subject: [PATCH] ApiFeedWatchlist: Use guessSectionNameFromWikiText() Instead of reimplementing almost all of it by scraping it together from various sources. Change-Id: I22f0020e65e4c6c09edf030ae35fdee5bdaaf7bc --- includes/api/ApiFeedWatchlist.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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']; -- 2.20.1