public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH widget-toolkit] toolkit: override email VType validation
@ 2021-04-08 12:41 Stoiko Ivanov
  2021-04-13  7:09 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Stoiko Ivanov @ 2021-04-08 12:41 UTC (permalink / raw)
  To: pve-devel

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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-13  7:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-08 12:41 [pve-devel] [PATCH widget-toolkit] toolkit: override email VType validation Stoiko Ivanov
2021-04-13  7:09 ` [pve-devel] applied: " Thomas Lamprecht

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