]> git.mjollnir.org Git - moodle.git/commitdiff
weblib: validate_email() -- emails with a trailing dot in the local-part (user.@host...
authormartinlanghoff <martinlanghoff>
Thu, 20 Apr 2006 22:32:00 +0000 (22:32 +0000)
committermartinlanghoff <martinlanghoff>
Thu, 20 Apr 2006 22:32:00 +0000 (22:32 +0000)
lib/weblib.php

index 4cc79f1e015158ac617ff026badac2a881f70440..c65d345693ca86f03ed0a3341220fd794ccf749f 100644 (file)
@@ -1054,7 +1054,8 @@ function formerr($error) {
  */
 function validate_email($address) {
 
-    return (ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.
+    return (ereg('^[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+'.
+                 '(\.[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+)*'.
                   '@'.
                   '[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.
                   '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$',