mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ReplaceText
synced 2024-11-27 16:10:15 +00:00
Use WikiPageFactory to create WikiPage object
Bug: T259948 Change-Id: I7bacc0d3554e5591f826095fad8314a20c31107e
This commit is contained in:
parent
570ee448fe
commit
551b610abf
|
@ -112,7 +112,12 @@ class Job extends JobParent {
|
|||
|
||||
}
|
||||
} else {
|
||||
$wikiPage = new WikiPage( $this->title );
|
||||
if ( method_exists( MediaWikiServices::class, 'getWikiPageFactory' ) ) {
|
||||
// MW 1.36+
|
||||
$wikiPage = MediaWikiServices::getInstance()->getWikiPageFactory()->newFromTitle( $this->title );
|
||||
} else {
|
||||
$wikiPage = new WikiPage( $this->title );
|
||||
}
|
||||
$latestRevision = $wikiPage->getRevisionRecord();
|
||||
|
||||
if ( $latestRevision === null ) {
|
||||
|
|
Loading…
Reference in a new issue