X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FremoveInvalidEmails.php;h=0f67317dfb344d4ffcce64ab666e07952073ced6;hb=e464eff3a4a78652bd8bcb8111f296d738d53b79;hp=7ff69a1fecbef614742e333ffc51eebdf7108726;hpb=4770a3a93d1b95dc481af93e1fdc3f49c87dd66f;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/removeInvalidEmails.php b/maintenance/removeInvalidEmails.php index 7ff69a1fec..0f67317dfb 100644 --- a/maintenance/removeInvalidEmails.php +++ b/maintenance/removeInvalidEmails.php @@ -29,24 +29,24 @@ class RemoveInvalidEmails extends Maintenance { do { $rows = $dbr->select( 'user', - array( 'user_id', 'user_email' ), - array( + [ 'user_id', 'user_email' ], + [ 'user_id > ' . $dbr->addQuotes( $lastId ), 'user_email != ""', 'user_email_authenticated IS NULL' - ), + ], __METHOD__, - array( 'LIMIT' => $this->mBatchSize ) + [ 'LIMIT' => $this->mBatchSize ] ); $count = $rows->numRows(); - $badIds = array(); + $badIds = []; foreach ( $rows as $row ) { if ( !Sanitizer::validateEmail( trim( $row->user_email ) ) ) { $this->output( "Found bad email: {$row->user_email} for user #{$row->user_id}\n" ); $badIds[] = $row->user_id; - if ( $row->user_id > $lastId ) { - $lastId = $row->user_id; - } + } + if ( $row->user_id > $lastId ) { + $lastId = $row->user_id; } } @@ -56,8 +56,8 @@ class RemoveInvalidEmails extends Maintenance { $this->output( "Removing $badCount emails from the database.\n" ); $dbw->update( 'user', - array( 'user_email' => '' ), - array( 'user_id' => $badIds ), + [ 'user_email' => '' ], + [ 'user_id' => $badIds ], __METHOD__ ); foreach ( $badIds as $badId ) {