-
Bug
-
Resolution: Fixed
-
Minor
-
3.11.6
-
MOODLE_311_STABLE
-
MOODLE_311_STABLE, MOODLE_400_STABLE
-
An accidental blank line in divertallemailsexcept causes no emails to be diverted.
To reproduce:
- Enter an email address in divertallemailsto and an extra blank line in divertallemailsexcept
- Send a test email {siteurl}/admin/testoutgoingmailconf.php
- 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:
To
if ($pattern != "" and preg_match("/$pattern/", $email)) {