From b1afebf882db5296cd9dcea26ee66d5250922e53 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Thu, 11 Feb 2016 10:39:53 -0500 Subject: [PATCH] Fixed #26204 -- Reallowed dashes in top-level domains for URLValidator. Thanks Shai Berger for the review. --- django/core/validators.py | 9 ++++++++- docs/releases/1.8.10.txt | 3 +++ docs/releases/1.9.3.txt | 3 +++ tests/validators/invalid_urls.txt | 4 +++- tests/validators/valid_urls.txt | 4 ++++ 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/django/core/validators.py b/django/core/validators.py index 5e6265e507..28e1ed5403 100644 --- a/django/core/validators.py +++ b/django/core/validators.py @@ -86,7 +86,14 @@ class URLValidator(RegexValidator): hostname_re = r'[a-z' + ul + r'0-9](?:[a-z' + ul + r'0-9-]{0,61}[a-z' + ul + r'0-9])?' # Max length for domain name labels is 63 characters per RFC 1034 sec. 3.1 domain_re = r'(?:\.(?!-)[a-z' + ul + r'0-9-]{1,63}(?