diff options
author | thomascube <thomas@roundcube.net> | 2008-02-04 07:33:57 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2008-02-04 07:33:57 +0000 |
commit | e581e741537ce97b23e5439d23d4f3179872ed9b (patch) | |
tree | ec476c6e026c49e4597c00ddecc26a74d4eda349 /program/js | |
parent | 731e0e57f42f773c76e45e28d9377407277425bf (diff) |
Fix client side e-mail address check
Diffstat (limited to 'program/js')
-rw-r--r-- | program/js/common.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/program/js/common.js b/program/js/common.js index 40d97cb8f..6435f3b77 100644 --- a/program/js/common.js +++ b/program/js/common.js @@ -399,7 +399,8 @@ function rcube_check_email(input, inline) var domain = sub_domain+'(\\x2e'+sub_domain+')*'; var local_part = word+'(\\x2e'+word+')*'; var addr_spec = local_part+'\\x40'+domain; - var reg1 = inline ? new RegExp('(^|<)'+addr_spec+'(>|$)', 'i') : new RegExp('^'+addr_spec+'$', 'i'); + var delim = '[,;\s\n]'; + var reg1 = inline ? new RegExp('(^|<|'+delim+')'+addr_spec+'($|>|'+delim+')', 'i') : new RegExp('^'+addr_spec+'$', 'i'); return reg1.test(input) ? true : false; } return false; |