From 733b0e967de7094a94b9b657513e9e705e91060a Mon Sep 17 00:00:00 2001 From: paladox Date: Wed, 29 Nov 2023 13:35:51 -0500 Subject: [PATCH] Update Source.php --- includes/Source.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/Source.php b/includes/Source.php index ee8d1c4..e999098 100644 --- a/includes/Source.php +++ b/includes/Source.php @@ -238,7 +238,13 @@ class Source { if ( $this->page === null ) { // Access the property directly to avoid an infinite loop. if ( $this->title != null) { - $this->page = \WikiPage::factory( $this->title ); + // MW 1.36+ + if ( method_exists( MediaWikiServices::class, 'getWikiPageFactory' ) ) { + $wikiPageFactory = MediaWikiServices::getInstance()->getWikiPageFactory(); + $this->page = $wikiPageFactory->newFromTitle( $this->title ); + } else { + $this->page = \WikiPage::factory( $this->title ); + } } else { throw new Exception( 'Unable to create Page for this Source because Title is null.' ); }