X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcleanupBlocks.php;h=15bb4f3edee3b263c07877cf2ea99896f94916b2;hb=844cb9eff3952efefc48e996e8c2d415a23791d8;hp=41d492d4d8d0dcc140e2fe7a2287edaed27d1dbe;hpb=983173f3be216070d7bcd2c0930dfe86e39f5b5b;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/cleanupBlocks.php b/maintenance/cleanupBlocks.php index 41d492d4d8..15bb4f3ede 100644 --- a/maintenance/cleanupBlocks.php +++ b/maintenance/cleanupBlocks.php @@ -92,11 +92,12 @@ class CleanupBlocks extends Maintenance { $keep = $block->getExpiry() > $bestBlock->getExpiry(); } if ( $keep === null ) { - foreach ( [ 'createaccount', 'sendemail', 'editownusertalk' ] as $action ) { - if ( $block->prevents( $action ) xor $bestBlock->prevents( $action ) ) { - $keep = $block->prevents( $action ); - break; - } + if ( $block->isCreateAccountBlocked() xor $bestBlock->isCreateAccountBlocked() ) { + $keep = $block->isCreateAccountBlocked(); + } elseif ( $block->isEmailBlocked() xor $bestBlock->isEmailBlocked() ) { + $keep = $block->isEmailBlocked(); + } elseif ( $block->isUsertalkEditAllowed() xor $bestBlock->isUsertalkEditAllowed() ) { + $keep = $block->isUsertalkEditAllowed(); } } @@ -148,5 +149,5 @@ class CleanupBlocks extends Maintenance { } } -$maintClass = "CleanupBlocks"; +$maintClass = CleanupBlocks::class; require_once RUN_MAINTENANCE_IF_MAIN;