Upgrade to use of new MediaWiki\Title for use in MW 1.44

This commit is contained in:
2025-07-09 22:27:34 +02:00
parent 90edd23e4f
commit 5a32049982
10 changed files with 30 additions and 26 deletions

View File

@@ -64,7 +64,7 @@ class Extension {
// MW 1.36+
if ( method_exists( MediaWikiServices::class, 'getWikiPageFactory' ) ) {
$wikiPageFactory = MediaWikiServices::getInstance()->getWikiPageFactory();
$wikiPage = $wikiPageFactory->newFromTitle( $title );
$wikiPage = $wikiPageFactory->newFromLinkTarget( $title );
} else {
$wikiPage = WikiPage::factory( $title );
}
@@ -102,11 +102,11 @@ class Extension {
*
* Entry point for the SpecialLinkTitles class and the LinkTitlesJob class.
*
* @param \Title $title Title object.
* @param MediaWiki\Title\Title $title Title object.
* @param \RequestContext $context Current request context. If in doubt, call MediaWiki's `RequestContext::getMain()` to obtain such an object.
* @return bool True if the page exists, false if the page does not exist
*/
public static function processPage( \Title $title, \RequestContext $context ) {
public static function processPage( MediaWiki\Title\Title $title, \RequestContext $context ) {
$config = new Config();
$source = Source::createFromTitle( $title, $config );
if ( $source->hasContent() ) {