diff options
author | Chris Buechler <cmb@pfsense.org> | 2016-04-23 01:24:22 -0500 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2016-04-23 01:25:49 -0500 |
commit | 2f15f37389984def8060d4d59dd75e1c2a87bfe9 (patch) | |
tree | 862d6f25612601dbb2cbd5ddf9a75f6b674b2df9 /src/usr | |
parent | 2e4ae1eb4a02374404f705bfb1a569a44d6367b5 (diff) | |
download | pfsense-2f15f37389984def8060d4d59dd75e1c2a87bfe9.zip pfsense-2f15f37389984def8060d4d59dd75e1c2a87bfe9.tar.gz |
Hostnames are valid for NTP servers in DHCP Server. Ticket #6239
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/local/www/services_dhcp.php | 8 |
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( |