From 24003295088ec24d823f66bd5c8b917478b24c5d Mon Sep 17 00:00:00 2001 From: Anoop Thomas Mathew Date: Wed, 15 Apr 2015 00:12:49 +0530 Subject: [PATCH] Fixed #24349 -- Limited domain name labels to 63 characters in EmailValidator --- django/core/validators.py | 5 ++--- docs/releases/1.9.txt | 3 +++ tests/validators/tests.py | 11 ++++++++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/django/core/validators.py b/django/core/validators.py index a62f04e1a3..3e4e744ff3 100644 --- a/django/core/validators.py +++ b/django/core/validators.py @@ -142,9 +142,8 @@ 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 249: 254 (max email length) minus one - # period, two characters for the TLD, @ sign, & one character before @. - r'(?:[A-Z0-9](?:[A-Z0-9-]{0,247}[A-Z0-9])?\.)+(?:[A-Z]{2,6}|[A-Z0-9-]{2,}(?