From 39ad6aa3a29801c7261e4927c0d2dd3039d40f25 Mon Sep 17 00:00:00 2001 From: paladox Date: Wed, 27 Dec 2023 23:52:36 +0000 Subject: [PATCH] Update Target.php --- includes/Target.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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(); }