mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-27 23:40:19 +00:00
Remove call to deprecated User::isBlocked
Change-Id: Ibb7412f8aa08a745a211b9b0581ccb6b0ca9eff5
This commit is contained in:
parent
7189bbfee0
commit
f23905c402
|
@ -376,6 +376,11 @@ class AFComputedVariable {
|
|||
|
||||
$result = call_user_func( [ $obj, $method ] );
|
||||
break;
|
||||
case 'user-block':
|
||||
// @todo Support partial blocks
|
||||
$user = $parameters['user'];
|
||||
$result = (bool)$user->getBlock();
|
||||
break;
|
||||
case 'user-age':
|
||||
$user = $parameters['user'];
|
||||
$asOf = $parameters['asof'];
|
||||
|
|
|
@ -319,8 +319,8 @@ class AbuseFilter {
|
|||
|
||||
$vars->setLazyLoadVar(
|
||||
'user_blocked',
|
||||
'simple-user-accessor',
|
||||
[ 'user' => $user, 'method' => 'isBlocked' ]
|
||||
'user-block',
|
||||
[ 'user' => $user ]
|
||||
);
|
||||
|
||||
Hooks::run( 'AbuseFilter-generateUserVars', [ $vars, $user ] );
|
||||
|
|
|
@ -233,8 +233,8 @@ class AbuseFilterConsequencesTest extends MediaWikiTestCase {
|
|||
$user = User::newFromName( 'FilteredUser' );
|
||||
$user->addToDatabase();
|
||||
$user->addGroup( 'sysop' );
|
||||
if ( $user->isBlocked() ) {
|
||||
$block = Block::newFromTarget( $user );
|
||||
$block = Block::newFromTarget( $user );
|
||||
if ( $block ) {
|
||||
$block->delete();
|
||||
}
|
||||
self::$mUser = $user;
|
||||
|
|
Loading…
Reference in a new issue