mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TitleBlacklist
synced 2024-11-24 06:04:05 +00:00
Replace use of deprecated Parser::$mTitle
Parser::getTitle is also deprecated, using getPage + TitleFormatter instead Bug: T275160 Change-Id: I90b0bba6c2a8283f2257dbf2e140e893e3f62442
This commit is contained in:
parent
21964ef377
commit
890c1ed9b8
|
@ -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 ) {
|
||||
|
|
Loading…
Reference in a new issue