From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH widget-toolkit] toolkit: override email VType validation
Date: Thu, 8 Apr 2021 14:41:18 +0200 [thread overview]
Message-ID: <20210408124118.10185-1-s.ivanov@proxmox.com> (raw)
ExtJS email validation regex has a length limit of 6 on the TLD.
This breaks some new gTLDs (e.g. .systems)
Override the validation function and verify against the EMAILRE from
PVE::Tools (used for 'e-mail' in JSONSchema)
Reported in our community forum:
https://forum.proxmox.com/threads/acme-account-register-dialog-does-not-accept-gtlds.87305/
Quickly tested (by using test@test.systems(|test)? on my test-installation)
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
src/Toolkit.js | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/Toolkit.js b/src/Toolkit.js
index b011c38..6ae31ed 100644
--- a/src/Toolkit.js
+++ b/src/Toolkit.js
@@ -182,6 +182,11 @@ Ext.apply(Ext.form.field.VTypes, {
},
passwordText: gettext('Passwords do not match'),
+
+ email: function(value) {
+ let emailre = /^[\w+~-]+(\.[\w+~-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)$/;
+ return emailre.test(value);
+ },
});
// Firefox 52+ Touchscreen bug
--
2.20.1
next reply other threads:[~2021-04-08 12:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-08 12:41 Stoiko Ivanov [this message]
2021-04-13 7:09 ` [pve-devel] applied: " Thomas Lamprecht
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=20210408124118.10185-1-s.ivanov@proxmox.com \
--to=s.ivanov@proxmox.com \
--cc=pve-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