Update cssjanus/cssjanus from 1.2.1 to 1.3.0
[lhc/web/wiklou.git] / maintenance / cleanupBlocks.php
index cbf0084..15bb4f3 100644 (file)
@@ -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();
                                                }
                                        }