Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#25779 closed defect (bug) (fixed)

wp_notify_moderator() sends multiple emails to the same person if the email addresses are not the same case

Reported by: westi Owned by: SergeyBiryukov
Priority: normal Milestone: 3.8
Component: Mail Version: 3.1
Severity: normal Keywords: has-patch commit
Cc: Focuses:

Description

In the code we have:

$emails = array( get_option('admin_email') );
if ( user_can($user->ID, 'edit_comment', $comment_id) && !empty($user->user_email) && ( get_option('admin_email') != $user->user_email) )
    $emails[] = $user->user_email;

If the Post Author's email address is something like Foo@bar.com and the admin_email is foo@bar.com then we will send two emails to the same person.

While ​RFC2821 says:

The local-part of a mailbox MUST BE treated as case sensitive. Therefore, SMTP implementations MUST take care to preserve the case of mailbox local-parts. Mailbox domains are not case sensitive.

WordPress already treats email addresses as case insensitive in other places and places like gmail does too.

Attachments (2)

25779.patch​ (2.3 KB ) - added by SergeyBiryukov 13 years ago.
25779.2.patch​ (2.3 KB ) - added by SergeyBiryukov 13 years ago.
Fixed a typo

Download all attachments as: .zip

Change History (7)

#1 @SergeyBiryukov
13 years ago

  • Milestone Awaiting Review → 3.8
  • Version 3.7.1 → 3.1

Introduced in [16223].

#2 @SergeyBiryukov
13 years ago

25779.patch​ uses strcasecmp() to compare emails in wp_notify_moderator(), wp_password_change_notification(), and revoke_super_admin(). These are all the instances I could find.

Last edited 13 years ago by SergeyBiryukov (previous) (diff)

#3 @SergeyBiryukov
13 years ago

  • Component Comments → Mail
  • Keywords has-patch added; needs-patch removed

#4 @SergeyBiryukov
13 years ago

  • Keywords commit added

#5 @SergeyBiryukov
13 years ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → closed

In 26115:

Use case-insensitive comparison for email addresses. fixes #25779.

Note: See TracTickets for help on using tickets.