From: Maximiliano Sandoval Date: Mon, 26 Feb 2024 15:32:46 +0000 (+0100) Subject: utils: anchor regex expression X-Git-Url: https://git.proxmox.com/?p=pmg-gui.git;a=commitdiff_plain;h=443e7de1f4ec4122944477b7f649a6f02945b3ef utils: anchor regex expression Without anchoring this would match for example `a@b/c`. Signed-off-by: Maximiliano Sandoval --- diff --git a/js/Utils.js b/js/Utils.js index 9009e9e..149abd6 100644 --- a/js/Utils.js +++ b/js/Utils.js @@ -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", });