Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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:
- Anonymous 1 posts a comment using anonymous1@example.org as email
- when other users post comments, Anonymous 1 is correctly notified once for each comment
- Anonymous 1 posts another comment, now using Anonymous1@example.org as email (note the capital A)
- 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.
Comment | File | Size | Author |
---|---|---|---|
#1 | duplicate_notify_001.patch | 1.27 KB | nicorac |
Comments
Comment #1
nicorac CreditAttribution: nicorac commentedAttaching 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.
Comment #2
gregglesMakes sense to me. Can anyone else review?
Comment #3
gregglesNow committed to 7.x and 6.x http://drupalcode.org/project/comment_notify.git/commit/ed8e98a and http://drupalcode.org/project/comment_notify.git/commit/81e0ec8
Thanks for your help, nicorac!
Comment #4
nicorac CreditAttribution: nicorac commentedYou're welcome ;)