Duplicate Banned email last_trigger_date is not reliably set

Xon

Well-known member
Affected version
2.1.2
In \XF\Entity\User::verifyEmail, last_triggered_date is populated by doing a direct email lookup against the \XF\Entity\BanEmail::$email. Except the email in the BanEmail entity can match wild-cards, so the last_triggered_date for exact matches

PHP:
$email = $emailValidator->coerceValue($email);
if (!$emailValidator->isValid($email, $errorKey))
{
   if ($errorKey == 'banned')
   {
      $this->error(\XF::phrase('email_address_you_entered_has_been_banned_by_administrator'), 'email');
      
      $emailBan = $this->finder('XF:BanEmail')->where('banned_email', $email)->fetchOne();
      if ($emailBan)
      {
         $emailBan->fastUpdate('last_triggered_date', time());
      }
   }
 
You reported this for XF 2.1.2, but we made changes in XF 2.1.2 and this code is different now.
 
Apologies, was looking at the wrong version of XF! (having to support multiple versions can be 'fun')
 
Back
Top Bottom