Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-74408

Ignore blank lines in email diversion exceptions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.11.8, 4.0.2
    • 3.11.6
    • Email

      An accidental blank line in divertallemailsexcept causes no emails to be diverted.

      To reproduce:

      1. Enter an email address in divertallemailsto and an extra blank line in divertallemailsexcept
      2. Send a test email {siteurl}/admin/testoutgoingmailconf.php
      3. Receive the test email without a diversion applied

      The email in step 2 should be diverted because blank lines are easy to include in the multi-line entry for divertallemailsexcept and processing a blank line defeats the whole point of the setting. Therefore blank lines should be ignored.

      To fix, this line needs changing:

      https://github.com/moodle/moodle/blob/7ce003b666a66b465ce9335f430a6e4d3535a7f1/lib/moodlelib.php#L5876

      To

              if ($pattern != "" and preg_match("/$pattern/", $email)) {

            pholden Paul Holden
            JohnPercival John Percival
            Laurent David Laurent David
            Andrew Lyons Andrew Lyons
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 5 minutes
                1h 5m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.