]> git.mjollnir.org Git - moodle.git/commitdiff
Make email address denying work a little more rigorously. bug 5250
authormoodler <moodler>
Thu, 20 Apr 2006 08:17:11 +0000 (08:17 +0000)
committermoodler <moodler>
Thu, 20 Apr 2006 08:17:11 +0000 (08:17 +0000)
lib/moodlelib.php

index 73d9c9a806446ff5097c77fb693bc502f8c00637..400434dbd8a21996cbf215f5148f401676510bb1 100644 (file)
@@ -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);
             }
         }