From 890c1ed9b841e65a16ccb750835051e336e49e7d Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Tue, 27 Dec 2022 13:00:16 +0100 Subject: [PATCH] Replace use of deprecated Parser::$mTitle Parser::getTitle is also deprecated, using getPage + TitleFormatter instead Bug: T275160 Change-Id: I90b0bba6c2a8283f2257dbf2e140e893e3f62442 --- includes/Scribunto_LuaTitleBlacklistLibrary.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/Scribunto_LuaTitleBlacklistLibrary.php b/includes/Scribunto_LuaTitleBlacklistLibrary.php index 8fe2e77f..1baed24e 100644 --- a/includes/Scribunto_LuaTitleBlacklistLibrary.php +++ b/includes/Scribunto_LuaTitleBlacklistLibrary.php @@ -2,6 +2,7 @@ namespace MediaWiki\Extension\TitleBlacklist; +use MediaWiki\MediaWikiServices; use Scribunto_LuaLibraryBase; class Scribunto_LuaTitleBlacklistLibrary extends Scribunto_LuaLibraryBase { @@ -20,7 +21,12 @@ class Scribunto_LuaTitleBlacklistLibrary extends Scribunto_LuaLibraryBase { $this->checkTypeOptional( 'mw.ext.TitleBlacklist.test', 2, $title, 'string', '' ); $this->incrementExpensiveFunctionCount(); if ( $title == '' ) { - $title = $this->getParser()->mTitle->getPrefixedText(); + $page = $this->getParser()->getPage(); + if ( !$page ) { + // Nothing to check + return [ null ]; + } + $title = MediaWikiServices::getInstance()->getTitleFormatter()->getPrefixedText( $page ); } $entry = TitleBlacklist::singleton()->isBlacklisted( $title, $action ); if ( $entry ) {