From 8ff248d6a3f31dba42c4c64b5290928030faad4a Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sun, 31 Jul 2016 10:38:32 +0200 Subject: Allow URLs for TFTP Server (Bug #6634) is_URL() from util.inc is way too limited for this purpose. --- src/usr/local/www/services_dhcp_edit.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/usr/local/www/services_dhcp_edit.php') diff --git a/src/usr/local/www/services_dhcp_edit.php b/src/usr/local/www/services_dhcp_edit.php index 28f9c17..53dd933 100644 --- a/src/usr/local/www/services_dhcp_edit.php +++ b/src/usr/local/www/services_dhcp_edit.php @@ -281,8 +281,8 @@ if ($_POST) { if (($_POST['ntp1'] && !is_ipaddrv4($_POST['ntp1'])) || ($_POST['ntp2'] && !is_ipaddrv4($_POST['ntp2']))) { $input_errors[] = gettext("A valid IP address must be specified for the primary/secondary NTP servers."); } - if ($_POST['tftp'] && !is_ipaddrv4($_POST['tftp']) && !is_domain($_POST['tftp']) && !is_URL($_POST['tftp'])) { - $input_errors[] = gettext("A valid IP address or hostname must be specified for the TFTP server."); + if ($_POST['tftp'] && !is_ipaddrv4($_POST['tftp']) && !is_domain($_POST['tftp']) && !filter_var($_POST['tftp'], FILTER_VALIDATE_URL)) { + $input_errors[] = gettext("A valid IP address, hostname or URL must be specified for the TFTP server."); } if (($_POST['nextserver'] && !is_ipaddrv4($_POST['nextserver']))) { $input_errors[] = gettext("A valid IP address must be specified for the network boot server."); -- cgit v1.1