Module: check_mk
Branch: master
Commit: 0fa76f10a677239a8190b5080fe933ecbc29c39e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0fa76f10a67723…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jun 5 11:52:29 2015 +0200
#2340 FIX Email validation: Top level domains can now have a maximum length of 24
characters
---
.werks/2340 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/valuespec.py | 5 ++++-
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/.werks/2340 b/.werks/2340
new file mode 100644
index 0000000..b5b2fa6
--- /dev/null
+++ b/.werks/2340
@@ -0,0 +1,9 @@
+Title: Email validation: Top level domains can now have a maximum length of 24
characters
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.7i2
+Date: 1433497930
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 7839e46..fedb555 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,7 @@
* 2335 FIX: Fixed PNP default template for active checks with arguments...
* 2337 FIX: Fixed problem with long hanging pnp graph rendering calls
* 2338 FIX: Logging internal GUI exceptions to web.log instead of apache
error_log...
+ * 2340 FIX: Email validation: Top level domains can now have a maximum length of 24
characters
BI:
* 2336 FIX: BI compilation diagnostics are now logged to the generic web.log...
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 0294774..12ea130 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -512,7 +512,10 @@ class EmailAddress(TextAscii):
def __init__(self, **kwargs):
kwargs.setdefault("size", 40)
TextAscii.__init__(self, **kwargs)
- self._regex =
re.compile('^[A-Z0-9._%+-]+(a)(localhost|[A-Z0-9.-]+\.[A-Z]{2,4})$'})$', re.I)
+ # The "new" top level domains are very unlimited in length.
Theoretically they can be
+ # up to 63 chars long. But currently the longest is 24 characters. Check this out
with:
+ # wget -qO -
http://data.iana.org/TLD/tlds-alpha-by-domain.txt | tail -n+2 | wc
-L
+ self._regex =
re.compile('^[A-Z0-9._%+-]+(a)(localhost|[A-Z0-9.-]+\.[A-Z]{2,24})$'})$', re.I)
self._make_clickable = kwargs.get("make_clickable", False)
def value_to_text(self, value):