From: martinlanghoff Date: Thu, 20 Apr 2006 22:32:00 +0000 (+0000) Subject: weblib: validate_email() -- emails with a trailing dot in the local-part (user.@host... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=78fbaeaeedeb0980cabe80bc6379c160d78896a4;p=moodle.git weblib: validate_email() -- emails with a trailing dot in the local-part (user.@host.com) are invalid --- diff --git a/lib/weblib.php b/lib/weblib.php index 4cc79f1e01..c65d345693 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -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{|}~]+$',