If an anonymous user posts more than one comment using the same email BUT different case, comment_notify will send him more than one notify message.

I'll try to explain with an example:

  1. Anonymous 1 posts a comment using anonymous1@example.org as email
  2. when other users post comments, Anonymous 1 is correctly notified once for each comment
  3. Anonymous 1 posts another comment, now using Anonymous1@example.org as email (note the capital A)
  4. when other users post comments, Anonymous 1 is being notified twice: once at anonymous1@example.org and once at Anonymous1@example.org

_comment_notify_mailalert() function already contains a test to avoid multiple send to the same recipient, but this test is case-sensitive, so it does not work with my test case.

CommentFileSizeAuthor
#1 duplicate_notify_001.patch1.27 KBnicorac
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nicorac’s picture

Status: Needs work » Needs review
FileSize
1.27 KB

Attaching patch that fixes this issue.
I think that the best solution is to force everything that goes into $sent_to[] array to be lowercase.
This way no other variable is modified.

greggles’s picture

Makes sense to me. Can anyone else review?

greggles’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Needs review » Fixed
nicorac’s picture

You're welcome ;)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.