]> git.proxmox.com Git - pve-common.git/commitdiff
Allow top level devel domain name up to 63 characters in email adresses
authorEmmanuel Kasper <e.kasper@proxmox.com>
Thu, 17 Sep 2015 10:11:09 +0000 (12:11 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 17 Sep 2015 10:56:48 +0000 (12:56 +0200)
This corrects the server side validation, and fixes the bug: https://bugzilla.proxmox.com/show_bug.cgi?id=716

src/PVE/JSONSchema.pm

index cb2d56e1a08482f8b85016c9cde5b1e3738e6f07..dbe2e3516493350e3ca6509e68529d9916a1b6ab 100644 (file)
@@ -245,8 +245,8 @@ register_format('email', \&pve_verify_email);
 sub pve_verify_email {
     my ($email, $noerr) = @_;
 
 sub pve_verify_email {
     my ($email, $noerr) = @_;
 
-    # we use same regex as extjs Ext.form.VTypes.email
-    if ($email !~ /^(\w+)([\-+.][\w]+)*@(\w[\-\w]*\.){1,5}([A-Za-z]){2,6}$/) {
+    # we use same regex as in Utils.js
+    if ($email !~ /^(\w+)([\-+.][\w]+)*@(\w[\-\w]*\.){1,5}([A-Za-z]){2,63}$/) {
           return undef if $noerr;
           die "value does not look like a valid email address\n";
     }
           return undef if $noerr;
           die "value does not look like a valid email address\n";
     }