mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RSS
synced 2024-11-11 16:59:16 +00:00
Replace deprecated Parser::getFreshParser
Bug: T325959 Change-Id: Idc61f7f6beda4b71959e7e9781861d56a2291f6f
This commit is contained in:
parent
1ab96ffeb7
commit
ec3f4fe4c6
|
@ -6,6 +6,7 @@ use DOMDocument;
|
|||
use MediaWiki\MediaWikiServices;
|
||||
use MWHttpRequest;
|
||||
use Parser;
|
||||
use ParserFactory;
|
||||
use PPFrame;
|
||||
use Sanitizer;
|
||||
use Status;
|
||||
|
@ -37,6 +38,11 @@ class RSSParser {
|
|||
*/
|
||||
private $cache;
|
||||
|
||||
/**
|
||||
* @var ParserFactory
|
||||
*/
|
||||
private $parserFactory;
|
||||
|
||||
/**
|
||||
* @var RSSData
|
||||
*/
|
||||
|
@ -73,6 +79,7 @@ class RSSParser {
|
|||
$this->markerString = "'\"" . wfRandomString( 32 );
|
||||
$this->stripItems = [];
|
||||
$this->cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
|
||||
$this->parserFactory = MediaWikiServices::getInstance()->getParserFactory();
|
||||
|
||||
# Get max number of headlines from argument-array
|
||||
if ( isset( $args['max'] ) ) {
|
||||
|
@ -342,7 +349,7 @@ class RSSParser {
|
|||
* @return string
|
||||
*/
|
||||
protected function sandboxParse( $wikiText, $origParser ) {
|
||||
$myParser = $origParser->getFreshParser();
|
||||
$myParser = $this->parserFactory->getInstance();
|
||||
$result = $myParser->parse(
|
||||
$wikiText,
|
||||
$origParser->getTitle(),
|
||||
|
|
Loading…
Reference in a new issue