From dcf116b6e81d3ba46a84925b340fe4e5a6e4f959 Mon Sep 17 00:00:00 2001 From: Lens0021 / Leslie Date: Sat, 21 Sep 2024 22:49:34 +0900 Subject: [PATCH] Check expiry and add missing return statement (#169) --- includes/HookHandlers/SpamEmail.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/HookHandlers/SpamEmail.php b/includes/HookHandlers/SpamEmail.php index 80a1721..d4a8dbc 100644 --- a/includes/HookHandlers/SpamEmail.php +++ b/includes/HookHandlers/SpamEmail.php @@ -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(); @@ -78,5 +81,6 @@ static function ( $block ) { $result = false; return false; } + return true; } }