From 1f8bb95cc2286a882e0f7a4692f77b285d811d11 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Fri, 4 Jul 2014 20:45:26 -0400 Subject: [PATCH] Corrected domain max length for EmailValidator; refs #20631. Thanks MarkusH for the report. --- django/core/validators.py | 6 +++--- tests/validators/tests.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/django/core/validators.py b/django/core/validators.py index 315c2c6318..51bf94cca1 100644 --- a/django/core/validators.py +++ b/django/core/validators.py @@ -124,9 +124,9 @@ class EmailValidator(object): r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-\011\013\014\016-\177])*"$)', # quoted-string re.IGNORECASE) domain_regex = re.compile( - # max length of the domain is 251: 254 (max email length) minus one - # period and two characters for the TLD. - r'(?:[A-Z0-9](?:[A-Z0-9-]{0,249}[A-Z0-9])?\.)+(?:[A-Z]{2,6}|[A-Z0-9-]{2,}(?