Allow URLs for TFTP Server (Bug #6634)

is_URL() from util.inc is way too limited for this purpose.
(cherry picked from commit 4838163139)
This commit is contained in:
doktornotor 2016-07-31 10:21:57 +02:00 committed by Renato Botelho
parent 2d8770b2ce
commit 2e5a481c91

View File

@ -362,8 +362,8 @@ if (isset($_POST['save'])) {
if (($_POST['domain'] && !is_domain($_POST['domain']))) {
$input_errors[] = gettext("A valid domain name must be specified for the DNS domain.");
}
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.");
f ($_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.");