summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/services_dhcp.php
diff options
context:
space:
mode:
authorChris Buechler <cmb@pfsense.org>2016-04-23 01:24:22 -0500
committerChris Buechler <cmb@pfsense.org>2016-04-23 01:24:22 -0500
commit39bfb267b1c44742afef724e65bfce2e2b2870d3 (patch)
tree73d3daa28b91c6b4b5975de0b4aa83e4403fb1ce /src/usr/local/www/services_dhcp.php
parent2284daf2986124fc7786641774fbc3064e001465 (diff)
downloadpfsense-39bfb267b1c44742afef724e65bfce2e2b2870d3.zip
pfsense-39bfb267b1c44742afef724e65bfce2e2b2870d3.tar.gz
Hostnames are valid for NTP servers in DHCP Server. Ticket #6239
Diffstat (limited to 'src/usr/local/www/services_dhcp.php')
-rw-r--r--src/usr/local/www/services_dhcp.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/usr/local/www/services_dhcp.php b/src/usr/local/www/services_dhcp.php
index 1b485fc..031b62c 100644
--- a/src/usr/local/www/services_dhcp.php
+++ b/src/usr/local/www/services_dhcp.php
@@ -356,8 +356,8 @@ if (isset($_POST['save'])) {
$input_errors[] = gettext("If a mac deny list is specified, it must contain only valid partial MAC addresses.");
}
- 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['ntp1'] && (!is_ipaddrv4($_POST['ntp1']) && !is_hostname($_POST['ntp1']))) || ($_POST['ntp2'] && (!is_ipaddrv4($_POST['ntp2']) && !is_hostname($_POST['ntp2'])))) {
+ $input_errors[] = gettext("A valid IP address or hostname must be specified for the primary/secondary NTP servers.");
}
if (($_POST['domain'] && !is_domain($_POST['domain']))) {
$input_errors[] = gettext("A valid domain name must be specified for the DNS domain.");
@@ -1094,13 +1094,13 @@ $section->addInput(new Form_IpAddress(
'ntp1',
'NTP Server 1',
$pconfig['ntp1']
-));
+))->setPattern('[.a-zA-Z0-9_]+');
$section->addInput(new Form_IpAddress(
'ntp2',
'NTP Server 2',
$pconfig['ntp2']
-));
+))->setPattern('[.a-zA-Z0-9_]+');
// Advanced TFTP
$btnadv = new Form_Button(
OpenPOWER on IntegriCloud