From 73567ffdebf3782ca890855122d3d4736365ff8a Mon Sep 17 00:00:00 2001 From: lens0021 Date: Sun, 22 Sep 2024 00:14:58 +0900 Subject: [PATCH] Fix checking blocker instead of target --- includes/HookHandlers/SpamEmail.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/includes/HookHandlers/SpamEmail.php b/includes/HookHandlers/SpamEmail.php index d4a8dbc..d11f5b4 100644 --- a/includes/HookHandlers/SpamEmail.php +++ b/includes/HookHandlers/SpamEmail.php @@ -69,9 +69,13 @@ static function ( $block ) { if ( wfTimestampNow() > $block->getExpiry() ) { return null; } - $id = $block->getBlocker(); - if ( $id ) { - return User::newFromIdentity( $id )->getEmail(); + $target = $block->getTargetUserIdentity(); + if ( $target == null ) { + return null; + } + $target = User::newFromIdentity( $target ); + if ( $target ) { + return $target->getEmail(); } return null; },