Make email address denying work a little more rigorously. bug 5250

This commit is contained in:
moodler
2006-04-20 08:17:11 +00:00
parent 20a730762f
commit 02c649e69e
+2 -2
View File
@@ -4069,7 +4069,7 @@ function email_is_not_allowed($email) {
if (!$allowedpattern) {
continue;
}
if (strpos($email, $allowedpattern) !== false) { // Match!
if (strpos(strrev($email), strrev($allowedpattern)) === 0) { // Match! (bug 5250)
return false;
}
}
@@ -4082,7 +4082,7 @@ function email_is_not_allowed($email) {
if (!$deniedpattern) {
continue;
}
if (strpos($email, $deniedpattern) !== false) { // Match!
if (strpos(strrev($email), strrev($deniedpattern)) === 0) { // Match! (bug 5250)
return get_string('emailnotallowed', '', $CFG->denyemailaddresses);
}
}