]> git.proxmox.com Git - pmg-gui.git/commitdiff
utils: anchor regex expression
authorMaximiliano Sandoval <m.sandoval@proxmox.com>
Mon, 26 Feb 2024 15:32:46 +0000 (16:32 +0100)
committerDominik Csapak <d.csapak@proxmox.com>
Tue, 27 Feb 2024 09:21:38 +0000 (10:21 +0100)
Without anchoring this would match for example `a@b/c`.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
js/Utils.js

index 9009e9e2573fb4a6017b1ecadbf6ea15fcb0ef0f..149abd684711812bb47b3f820048544a4f8b7764 100644 (file)
@@ -921,7 +921,7 @@ Ext.define('PMG.Async', {
 Ext.apply(Ext.form.field.VTypes, {
     // matches the pmg-email-address in pmg-api
     PMGMail: function(v) {
-       return (/[^\s\\@]+@[^\s/\\@]+/).test(v);
+       return (/^[^\s\\@]+@[^\s/\\@]+$/).test(v);
     },
     PMGMailText: gettext('Example') + ": user@example.com",
 });