X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcleanupBlocks.php;h=15bb4f3edee3b263c07877cf2ea99896f94916b2;hb=c5ffaf22539f0c5e422831332081c03ae92ca304;hp=5c5c88f0b0fb788dc81a50a70862c872db79ac7d;hpb=52e76843e268180a6f7add00f1105c42bf6a4ee8;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/cleanupBlocks.php b/maintenance/cleanupBlocks.php index 5c5c88f0b0..15bb4f3ede 100644 --- a/maintenance/cleanupBlocks.php +++ b/maintenance/cleanupBlocks.php @@ -55,8 +55,8 @@ class CleanupBlocks extends Maintenance { 'ipblocks', [ 'ipb_user' ], [ - "ipb_user >= $from", - "ipb_user <= $to", + "ipb_user >= " . (int)$from, + "ipb_user <= " . (int)$to, ], __METHOD__, [ @@ -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(); } } @@ -128,8 +129,8 @@ class CleanupBlocks extends Maintenance { [ 'ipb_id', 'user_name' ], [ 'ipb_user = user_id', - "ipb_user >= $from", - "ipb_user <= $to", + "ipb_user >= " . (int)$from, + "ipb_user <= " . (int)$to, 'ipb_address != user_name', ], __METHOD__ @@ -148,5 +149,5 @@ class CleanupBlocks extends Maintenance { } } -$maintClass = "CleanupBlocks"; +$maintClass = CleanupBlocks::class; require_once RUN_MAINTENANCE_IF_MAIN;