diff options
| author | Alexey Sveshnikov <alexey.sveshnikov@gmail.com> | 2015-07-03 19:35:55 +0300 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-07-06 15:08:43 -0400 |
| commit | bc98bc56a52860688ea0ae2ec7b9e59ddb72a811 (patch) | |
| tree | e811bc575978eafc4f651e19970ba63409fc3be2 /django | |
| parent | b74b94445de4173351b8c347deac22129c549f0f (diff) | |
Fixed #25059 -- Allowed Punycode TLDs in URLValidator
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/validators.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/core/validators.py b/django/core/validators.py index 3e4e744ff3..9feb33e8e9 100644 --- a/django/core/validators.py +++ b/django/core/validators.py @@ -74,7 +74,7 @@ class URLValidator(RegexValidator): # Host patterns hostname_re = r'[a-z' + ul + r'0-9](?:[a-z' + ul + r'0-9-]*[a-z' + ul + r'0-9])?' domain_re = r'(?:\.[a-z' + ul + r'0-9]+(?:[a-z' + ul + r'0-9-]*[a-z' + ul + r'0-9]+)*)*' - tld_re = r'\.[a-z' + ul + r']{2,}\.?' + tld_re = r'\.(?:[a-z' + ul + r']{2,}|xn--[a-z0-9]+)\.?' host_re = '(' + hostname_re + domain_re + tld_re + '|localhost)' regex = re.compile( |
