utils: anchor regex expression

Without anchoring this would match for example `a@b/c`.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
This commit is contained in:
Maximiliano Sandoval 2024-02-26 16:32:46 +01:00 committed by Dominik Csapak
parent aa2fe15562
commit 443e7de1f4

View 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",
});