Remove Revision::getRevisionText from ApiQueryDeletedrevs
[lhc/web/wiklou.git] / includes / api / ApiFeedWatchlist.php
index 11b5d91..953c4d8 100644 (file)
@@ -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,
@@ -148,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() );
@@ -209,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'];