]> git.proxmox.com Git - pmg-api.git/commitdiff
improve pmg-email-address regex
authorDominik Csapak <d.csapak@proxmox.com>
Mon, 18 Feb 2019 16:12:10 +0000 (17:12 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 19 Feb 2019 08:56:57 +0000 (09:56 +0100)
the '|' is not necessary since the first option is empty (mitigated by
the minLength of 3) and add the '\' to forbidden characters since
they make problems with browser requests (browsers convert '\' to '/')

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PMG/Utils.pm

index 26c09218674f7627312bcb4a8c44f1743f964ac7..60fdc5e5d353933e7943c0bc72eec36929ec0595 100644 (file)
@@ -108,7 +108,7 @@ PVE::JSONSchema::register_standard_option('username', {
 PVE::JSONSchema::register_standard_option('pmg-email-address', {
     description => "Email Address (allow most characters).",
     type => 'string',
-    pattern => '(?:|[^\s\/\@]+\@[^\s\/\@]+)',
+    pattern => '(?:[^\s\/\\\@]+\@[^\s\/\\\@]+)',
     maxLength => 512,
     minLength => 3,
 });