X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiFeedWatchlist.php;h=c4977f4115cd65b4ad543a136e382b22ff553f77;hb=616525021b3691e30a980a42b837b7ad44ecfd09;hp=8c0b42df218435fdb9f35120469bb103fbc09050;hpb=f186496005a47a09aed6d46feea7302fe9d5f0e2;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiFeedWatchlist.php b/includes/api/ApiFeedWatchlist.php index 8c0b42df21..c4977f4115 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, @@ -61,7 +63,7 @@ class ApiFeedWatchlist extends ApiBase { } // limit to the number of hours going from now back - $endTime = wfTimestamp( TS_MW, time() - intval( $params['hours'] * 60 * 60 ) ); + $endTime = wfTimestamp( TS_MW, time() - (int)$params['hours'] * 60 * 60 ); // Prepare parameters for nested request $fauxReqArr = [ @@ -102,10 +104,8 @@ class ApiFeedWatchlist extends ApiBase { $fauxReqArr['wlallrev'] = ''; } - // Create the request $fauxReq = new FauxRequest( $fauxReqArr ); - // Execute $module = new ApiMain( $fauxReq ); $module->execute(); @@ -211,8 +211,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'];