Skip to content

Commit

Permalink
Check expiry and add missing return statement
Browse files Browse the repository at this point in the history
  • Loading branch information
lens0021 committed Sep 21, 2024
1 parent 7c8e46e commit 52b96d3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/HookHandlers/SpamEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ public function onIsValidEmailAddr( $addr, &$result ) {
// Check email addresses of block users
$emails = array_filter( array_unique( array_map(
static function ( $block ) {
if ( wfTimestampNow() > $block->getExpiry() ) {
return null;
}
$id = $block->getBlocker();
if ( $id ) {
return User::newFromIdentity( $id )->getEmail();
Expand All @@ -78,5 +81,6 @@ static function ( $block ) {
$result = false;
return false;
}
return true;
}
}

0 comments on commit 52b96d3

Please sign in to comment.