public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [pmg-devel] [PATCH pmg-gui v2] utils: anchor regex expression
Date: Mon, 26 Feb 2024 16:32:46 +0100	[thread overview]
Message-ID: <20240226153246.590574-1-m.sandoval@proxmox.com> (raw)

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

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
 js/Utils.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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





             reply	other threads:[~2024-02-26 15:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-26 15:32 Maximiliano Sandoval [this message]
2024-02-27  9:25 ` [pmg-devel] applied: " Dominik Csapak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240226153246.590574-1-m.sandoval@proxmox.com \
    --to=m.sandoval@proxmox.com \
    --cc=pmg-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal