Remove call to deprecated User::isBlocked

Change-Id: Ibb7412f8aa08a745a211b9b0581ccb6b0ca9eff5
This commit is contained in:
Thalia 2019-05-02 20:42:15 +01:00
parent 7189bbfee0
commit f23905c402
3 changed files with 9 additions and 4 deletions

View file

@ -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'];

View file

@ -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 ] );

View file

@ -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;