mirror of
https://github.com/django/django.git
synced 2025-10-25 14:46:09 +00:00
Fixed #26378 -- Allowed a left byte of zero in mixed IPv4/IPv6 validation.
This commit is contained in:
@@ -54,7 +54,8 @@ def clean_ipv6_address(ip_str, unpack_ipv4=False,
|
||||
|
||||
for index in range(len(hextets)):
|
||||
# Remove leading zeroes
|
||||
hextets[index] = hextets[index].lstrip('0')
|
||||
if '.' not in hextets[index]:
|
||||
hextets[index] = hextets[index].lstrip('0')
|
||||
if not hextets[index]:
|
||||
hextets[index] = '0'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user