From: skodak Date: Sat, 21 Apr 2007 20:06:56 +0000 (+0000) Subject: MDL-9233 denied and allowed email address domains are not matched correctly X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=917067018885e41ba701b2ce2d9ae06bcffa1153;p=moodle.git MDL-9233 denied and allowed email address domains are not matched correctly --- diff --git a/lib/moodlelib.php b/lib/moodlelib.php index b8311cf81f..c569b67781 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -3683,7 +3683,7 @@ function email_is_not_allowed($email) { if (!$allowedpattern) { continue; } - if (strpos(strrev($email), strrev($allowedpattern)) === 0) { // Match! (bug 5250) + if (strpos(strrev($email), strrev('@'.$allowedpattern)) === 0) { // Match! (bug 5250) return false; } } @@ -3696,7 +3696,7 @@ function email_is_not_allowed($email) { if (!$deniedpattern) { continue; } - if (strpos(strrev($email), strrev($deniedpattern)) === 0) { // Match! (bug 5250) + if (strpos(strrev($email), strrev('@'.$deniedpattern)) === 0) { // Match! (bug 5250) return get_string('emailnotallowed', '', $CFG->denyemailaddresses); } }