From 7418b1cca71490f8e7f206a0611433b76de5ed68 Mon Sep 17 00:00:00 2001 From: lens0021 Date: Sat, 21 Sep 2024 22:47:58 +0900 Subject: [PATCH] Check expiry and add missing return statement --- includes/HookHandlers/SpamEmail.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/HookHandlers/SpamEmail.php b/includes/HookHandlers/SpamEmail.php index 80a1721..656d8fe 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; } }