From 02c649e69e56807dd2fcdf166e369e5eaf07e5c0 Mon Sep 17 00:00:00 2001 From: moodler Date: Thu, 20 Apr 2006 08:17:11 +0000 Subject: [PATCH] Make email address denying work a little more rigorously. bug 5250 --- lib/moodlelib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 73d9c9a806446..400434dbd8a21 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); } }