Skip to content

Commit

Permalink
Fix checking blocker instead of target
Browse files Browse the repository at this point in the history
  • Loading branch information
lens0021 committed Sep 21, 2024
1 parent dcf116b commit 73567ff
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions includes/HookHandlers/SpamEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down

0 comments on commit 73567ff

Please sign in to comment.