mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-74408 core: exclude empty patterns in divert email config.
This commit is contained in:
parent
5500d143f4
commit
d91df53d63
@ -5874,7 +5874,7 @@ function email_should_be_diverted($email) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$patterns = array_map('trim', preg_split("/[\s,]+/", $CFG->divertallemailsexcept));
|
||||
$patterns = array_map('trim', preg_split("/[\s,]+/", $CFG->divertallemailsexcept, -1, PREG_SPLIT_NO_EMPTY));
|
||||
foreach ($patterns as $pattern) {
|
||||
if (preg_match("/$pattern/", $email)) {
|
||||
return false;
|
||||
|
@ -3408,6 +3408,22 @@ EOF;
|
||||
),
|
||||
true,
|
||||
),
|
||||
'alsodivertsblankline' => array(
|
||||
'divertallemailsto' => 'somewhere@elsewhere.com',
|
||||
'divertallemailsexcept' => "@dev.com\n",
|
||||
[
|
||||
'lionel@example.com',
|
||||
],
|
||||
true,
|
||||
),
|
||||
'divertsexceptionblankline' => array(
|
||||
'divertallemailsto' => 'somewhere@elsewhere.com',
|
||||
'divertallemailsexcept' => "@example.com\n",
|
||||
[
|
||||
'lionel@example.com',
|
||||
],
|
||||
false,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user