From 917067018885e41ba701b2ce2d9ae06bcffa1153 Mon Sep 17 00:00:00 2001 From: skodak Date: Sat, 21 Apr 2007 20:06:56 +0000 Subject: [PATCH] MDL-9233 denied and allowed email address domains are not matched correctly --- lib/moodlelib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } } -- 2.39.5