diff --git a/includes/Target.php b/includes/Target.php index f9afcd5..a76fcc3 100644 --- a/includes/Target.php +++ b/includes/Target.php @@ -191,7 +191,7 @@ class Target { */ public function getContent() { if ( $this->content === null ) { - $this->content = static::getPage(); + $this->content = static::getPageContents( $this->title ); }; return $this->content; } @@ -248,14 +248,15 @@ class Target { /** * Obtain a page's content. * Workaround for MediaWiki 1.36+ which deprecated Wikipage::factory. + * @param \Title $title * @return Content content object of the page */ - private static function getPage() { + private static function getPageContents( $title ) { if ( method_exists( MediaWikiServices::class, 'getWikiPageFactory' ) ) { $wikiPageFactory = MediaWikiServices::getInstance()->getWikiPageFactory(); - $page = $wikiPageFactory->newFromTitle( $this->title ); + $page = $wikiPageFactory->newFromTitle( $title ); } else { - $page = \WikiPage::factory( $this->title ); + $page = \WikiPage::factory( $title ); } return $page->getContent(); }