Loading django/core/validators.py +3 −3 Original line number Diff line number Diff line Loading @@ -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,}(?<!-))$', # 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,}(?<!-))$', re.IGNORECASE) literal_regex = re.compile( # literal form, ipv4 or ipv6 address (SMTP 4.1.3) Loading tests/validators/tests.py +3 −3 Original line number Diff line number Diff line Loading @@ -66,9 +66,9 @@ TEST_DATA = ( (validate_email, '"\\\011"@here.com', None), (validate_email, '"\\\012"@here.com', ValidationError), (validate_email, 'trailingdot@shouldfail.com.', ValidationError), # Max length of domain name in email is 251 (see validator for calculation) (validate_email, 'a@%s.com' % ('a' * 251), None), (validate_email, 'a@%s.com' % ('a' * 252), ValidationError), # Max length of domain name in email is 249 (see validator for calculation) (validate_email, 'a@%s.us' % ('a' * 249), None), (validate_email, 'a@%s.us' % ('a' * 250), ValidationError), (validate_slug, 'slug-ok', None), (validate_slug, 'longer-slug-still-ok', None), Loading Loading
django/core/validators.py +3 −3 Original line number Diff line number Diff line Loading @@ -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,}(?<!-))$', # 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,}(?<!-))$', re.IGNORECASE) literal_regex = re.compile( # literal form, ipv4 or ipv6 address (SMTP 4.1.3) Loading
tests/validators/tests.py +3 −3 Original line number Diff line number Diff line Loading @@ -66,9 +66,9 @@ TEST_DATA = ( (validate_email, '"\\\011"@here.com', None), (validate_email, '"\\\012"@here.com', ValidationError), (validate_email, 'trailingdot@shouldfail.com.', ValidationError), # Max length of domain name in email is 251 (see validator for calculation) (validate_email, 'a@%s.com' % ('a' * 251), None), (validate_email, 'a@%s.com' % ('a' * 252), ValidationError), # Max length of domain name in email is 249 (see validator for calculation) (validate_email, 'a@%s.us' % ('a' * 249), None), (validate_email, 'a@%s.us' % ('a' * 250), ValidationError), (validate_slug, 'slug-ok', None), (validate_slug, 'longer-slug-still-ok', None), Loading