X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiFeedWatchlist.php;h=953c4d8d93542f49d327122dd83d25f5e1b2b0a4;hb=70e1b9c450f6e07adc890222bef2599f9150f4af;hp=935bb096ab011be63f805ccb8a637873241a2f00;hpb=df519cca358ff1a0b7abfb217ba4b7dde2e98e81;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiFeedWatchlist.php b/includes/api/ApiFeedWatchlist.php index 935bb096ab..953c4d8d93 100644 --- a/includes/api/ApiFeedWatchlist.php +++ b/includes/api/ApiFeedWatchlist.php @@ -20,6 +20,8 @@ * @file */ +use MediaWiki\MediaWikiServices; + /** * This action allows users to get their watchlist items in RSS/Atom formats. * When executed, it performs a nested call to the API to get the needed data, @@ -102,10 +104,8 @@ class ApiFeedWatchlist extends ApiBase { $fauxReqArr['wlallrev'] = ''; } - // Create the request $fauxReq = new FauxRequest( $fauxReqArr ); - // Execute $module = new ApiMain( $fauxReq ); $module->execute(); @@ -150,6 +150,7 @@ class ApiFeedWatchlist extends ApiBase { if ( $e instanceof ApiUsageException ) { foreach ( $e->getStatusValue()->getErrors() as $error ) { + // @phan-suppress-next-line PhanUndeclaredMethod $msg = ApiMessage::create( $error ) ->inLanguage( $this->getLanguage() ); $errorTitle = $this->msg( 'api-feed-error-title', $msg->getApiCode() ); @@ -211,8 +212,8 @@ class ApiFeedWatchlist extends ApiBase { if ( $this->linkToSections && $comment !== null && preg_match( '!(.*)/\*\s*(.*?)\s*\*/(.*)!', $comment, $matches ) ) { - global $wgParser; - $titleUrl .= $wgParser->guessSectionNameFromWikiText( $matches[ 2 ] ); + $titleUrl .= MediaWikiServices::getInstance()->getParser() + ->guessSectionNameFromWikiText( $matches[ 2 ] ); } $timestamp = $info['timestamp'];