Skip to content

Commit

Permalink
Make email address denying work a little more rigorously. bug 5250
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Apr 20, 2006
1 parent 20a7307 commit 02c649e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/moodlelib.php
Expand Up @@ -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;
}
}
Expand All @@ -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);
}
}
Expand Down

0 comments on commit 02c649e

Please sign in to comment.