Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-11715

add_notifications() may generate up to three notifications for a single post being posted

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Invalid
    • 3.1.0-dev
    • None
    • Notification System
    • None

    Description

      When someone posts in a topic that I am subscribed to and have bookmarked, and he quotes me in the post, I get two emails (for the bookmark and the subscription) and three notifications (the former two plus for being quoted).

      How to reproduce:
      I configured my notification settings to receive email for both bookmarked and subscribed topics, but only get an on-site notification for being quoted.

      What goes wrong in the code?
      The notifications are added in the order quote, bookmark, subscription (functions_posting.php).

      1. Because I disabled the email method for quote notifications, my username is added to the ignore_users array with only the empty string method disabled.
      2. Now when the bookmark notification is added, the email method is still allowed and I get an email and the second notification.
      3. Because phpbb_notification_manager->add_notifications() uses array addition (with the + sign) to update $notified_users, the initial ignore value of only the empty string is kept with my username, and the subscription notification is still allowed on the email method, resulting in the second email and third notification.

      Attachments

        Issue Links

          Activity

            People

              Marc Marc
              rechosen rechosen [X] (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: