Skip to content

Commit

Permalink
Update SpamEmail.php
Browse files Browse the repository at this point in the history
  • Loading branch information
lens0021 authored Sep 21, 2024
1 parent ac7fd5a commit 5180397
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions includes/HookHandlers/SpamEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,15 @@ public function onIsValidEmailAddr( $addr, &$result ) {
}

// Check email addresses of block users
$dbr = $this->loadBalancer->getConnection( DB_REPLICA );
$emails = array_filter( array_unique( array_map(
static function ( $block ) use ( $dbr ) {
static function ( $block ) {
$id = $block->getBlocker();
if ( $id ) {
return User::newFromIdentity( $id )->getEmail();
}
return null;
},
$this->databaseBlockStore->newListFromConds( [ $dbr->expr( 'bt_user', '!=', null ) ] )
$this->databaseBlockStore->newListFromConds( [] )
) ) );
if ( in_array( $addr, $emails ) ) {
return false;
Expand Down

0 comments on commit 5180397

Please sign in to comment.