|
@@ -87,7 +87,7 @@ class URLValidator(RegexValidator):
|
|
|
r'^(?:[a-z0-9.+-]*)://' # scheme is validated separately
|
|
|
r'(?:[^\s:@/]+(?::[^\s:@/]*)?@)?' # user:pass authentication
|
|
|
r'(?:' + ipv4_re + '|' + ipv6_re + '|' + host_re + ')'
|
|
|
- r'(?::\d{2,5})?' # port
|
|
|
+ r'(?::\d{1,5})?' # port
|
|
|
r'(?:[/?#][^\s]*)?' # resource path
|
|
|
r'\Z', re.IGNORECASE)
|
|
|
message = _('Enter a valid URL.')
|
|
@@ -129,7 +129,7 @@ class URLValidator(RegexValidator):
|
|
|
raise
|
|
|
else:
|
|
|
# Now verify IPv6 in the netloc part
|
|
|
- host_match = re.search(r'^\[(.+)\](?::\d{2,5})?$', urlsplit(value).netloc)
|
|
|
+ host_match = re.search(r'^\[(.+)\](?::\d{1,5})?$', urlsplit(value).netloc)
|
|
|
if host_match:
|
|
|
potential_ip = host_match[1]
|
|
|
try:
|