mirror of
https://github.com/netbox-community/netbox.git
synced 2026-04-24 01:38:47 +02:00
Merge pull request #21721 from netbox-community/21698-custom-field-url-filter-is-too-restrictive-for-weird-ports
Fixes #21698: Fix validation of custom field URLs with single-digit ports
This commit is contained in:
@@ -34,7 +34,7 @@ class EnhancedURLValidator(URLValidator):
|
|||||||
r'^(?:[a-z0-9\.\-\+]*)://' # Scheme (enforced separately)
|
r'^(?:[a-z0-9\.\-\+]*)://' # Scheme (enforced separately)
|
||||||
r'(?:\S+(?::\S*)?@)?' # HTTP basic authentication
|
r'(?:\S+(?::\S*)?@)?' # HTTP basic authentication
|
||||||
r'(?:' + '|'.join(host_res) + ')' # IPv4, IPv6, FQDN, or hostname
|
r'(?:' + '|'.join(host_res) + ')' # IPv4, IPv6, FQDN, or hostname
|
||||||
r'(?::\d{2,5})?' # Port number
|
r'(?::\d{1,5})?' # Port number
|
||||||
r'(?:[/?#][^\s]*)?' # Path
|
r'(?:[/?#][^\s]*)?' # Path
|
||||||
r'\Z', re.IGNORECASE)
|
r'\Z', re.IGNORECASE)
|
||||||
schemes = None
|
schemes = None
|
||||||
|
|||||||
Reference in New Issue
Block a user