Fixed #25059 -- Allowed Punycode TLDs in URLValidator
This commit is contained in:
parent
b74b94445d
commit
bc98bc56a5
|
@ -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(
|
||||
|
|
|
@ -92,3 +92,6 @@ Bugfixes
|
|||
|
||||
* Fixed a regression in the ``unordered_list`` template filter on certain
|
||||
inputs (:ticket:`25031`).
|
||||
|
||||
* Fixed a regression in ``URLValidator`` that invalidated Punycode TLDs
|
||||
(:ticket:`25059`).
|
||||
|
|
|
@ -605,6 +605,7 @@ proxied
|
|||
proxying
|
||||
pseudocode
|
||||
psycopg
|
||||
Punycode
|
||||
Puthraya
|
||||
py
|
||||
pyformat
|
||||
|
|
|
@ -6,6 +6,7 @@ http://.com
|
|||
http://invalid-.com
|
||||
http://-invalid.com
|
||||
http://invalid.com-
|
||||
http://invalid.c-m
|
||||
http://inv-.alid-.com
|
||||
http://inv-.-alid.com
|
||||
file://localhost/path
|
||||
|
|
|
@ -48,6 +48,7 @@ http://مثال.إختبار
|
|||
http://例子.测试
|
||||
http://उदाहरण.परीक्षा
|
||||
http://-.~_!$&'()*+,;=:%40:80%2f::::::@example.com
|
||||
http://xn--7sbb4ac0ad0be6cf.xn--p1ai
|
||||
http://1337.net
|
||||
http://a.b-c.de
|
||||
http://223.255.255.254
|
||||
|
|
Loading…
Reference in New Issue