From: moodler Date: Thu, 20 Apr 2006 08:17:11 +0000 (+0000) Subject: Make email address denying work a little more rigorously. bug 5250 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=02c649e69e56807dd2fcdf166e369e5eaf07e5c0;p=moodle.git Make email address denying work a little more rigorously. bug 5250 --- diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 73d9c9a806..400434dbd8 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -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); } }