X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcleanupBlocks.php;h=15bb4f3edee3b263c07877cf2ea99896f94916b2;hb=b6a1f3bc774d043c69e9ed2875210049cdda9d68;hp=41d492d4d8d0dcc140e2fe7a2287edaed27d1dbe;hpb=f036c5b324e2b2d240edf8d5eeb7fc2af3d88c47;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;