mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[1.8.x] Fixed #25059 -- Allowed Punycode TLDs in URLValidator
Backport of bc98bc56a5 from master
This commit is contained in:
committed by
Tim Graham
parent
73cbf08159
commit
8c417564c7
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user