mirror of
https://github.com/diocloid/LinkTitles.git
synced 2025-07-13 09:49:31 +02:00
Update Source.php
This commit is contained in:
@ -238,7 +238,13 @@ class Source {
|
|||||||
if ( $this->page === null ) {
|
if ( $this->page === null ) {
|
||||||
// Access the property directly to avoid an infinite loop.
|
// Access the property directly to avoid an infinite loop.
|
||||||
if ( $this->title != null) {
|
if ( $this->title != null) {
|
||||||
|
// 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 );
|
$this->page = \WikiPage::factory( $this->title );
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Exception( 'Unable to create Page for this Source because Title is null.' );
|
throw new Exception( 'Unable to create Page for this Source because Title is null.' );
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user