mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-11904 deny/accept Email settings conflict with text - now .example.com means all subdomains
This commit is contained in:
parent
e5a3a5176d
commit
18f2700959
1 changed files with 14 additions and 2 deletions
|
@ -4050,7 +4050,13 @@ function email_is_not_allowed($email) {
|
||||||
if (!$allowedpattern) {
|
if (!$allowedpattern) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (strpos(strrev($email), strrev('@'.$allowedpattern)) === 0) { // Match! (bug 5250)
|
if (strpos($allowedpattern, '.') === 0) {
|
||||||
|
if (strpos(strrev($email), strrev($allowedpattern)) === 0) {
|
||||||
|
// subdomains are in a form ".example.com" - matches "xxx@anything.example.com"
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (strpos(strrev($email), strrev('@'.$allowedpattern)) === 0) { // Match! (bug 5250)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4063,7 +4069,13 @@ function email_is_not_allowed($email) {
|
||||||
if (!$deniedpattern) {
|
if (!$deniedpattern) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (strpos(strrev($email), strrev('@'.$deniedpattern)) === 0) { // Match! (bug 5250)
|
if (strpos($deniedpattern, '.') === 0) {
|
||||||
|
if (strpos(strrev($email), strrev($deniedpattern)) === 0) {
|
||||||
|
// subdomains are in a form ".example.com" - matches "xxx@anything.example.com"
|
||||||
|
return get_string('emailnotallowed', '', $CFG->denyemailaddresses);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (strpos(strrev($email), strrev('@'.$deniedpattern)) === 0) { // Match! (bug 5250)
|
||||||
return get_string('emailnotallowed', '', $CFG->denyemailaddresses);
|
return get_string('emailnotallowed', '', $CFG->denyemailaddresses);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue