diff options
author | Renato Botelho <garga@FreeBSD.org> | 2014-11-18 07:46:56 -0200 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-11-18 07:46:56 -0200 |
commit | 8a5265b212bcd4518c9dbb74c30408c89709a1b5 (patch) | |
tree | d6295b60f47c7043e3bbe96d086482662ab15adb /usr/local/www/services_dnsmasq_edit.php | |
parent | a0b72ec3700fae82a0fd42f28b29bdd2bf274ce7 (diff) | |
parent | da66ef4f93161efffa53f62a59bb1cbdf5e1f41b (diff) | |
download | pfsense-8a5265b212bcd4518c9dbb74c30408c89709a1b5.zip pfsense-8a5265b212bcd4518c9dbb74c30408c89709a1b5.tar.gz |
Merge pull request #1332 from phil-davis/patch-3
Diffstat (limited to 'usr/local/www/services_dnsmasq_edit.php')
-rw-r--r-- | usr/local/www/services_dnsmasq_edit.php | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/usr/local/www/services_dnsmasq_edit.php b/usr/local/www/services_dnsmasq_edit.php index 7f6d071..dce311c 100644 --- a/usr/local/www/services_dnsmasq_edit.php +++ b/usr/local/www/services_dnsmasq_edit.php @@ -86,8 +86,15 @@ if ($_POST) { do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); - if (($_POST['host'] && !is_hostname($_POST['host']))) - $input_errors[] = gettext("The hostname can only contain the characters A-Z, 0-9 and '-'."); + if ($_POST['host']) { + if (!is_hostname($_POST['host'])) { + $input_errors[] = gettext("The hostname can only contain the characters A-Z, 0-9 and '-'. It may not start or end with '-'."); + } else { + if (!is_unqualified_hostname($_POST['host'])) { + $input_errors[] = gettext("A valid hostname is specified, but the domain name part should be omitted"); + } + } + } if (($_POST['domain'] && !is_domain($_POST['domain']))) $input_errors[] = gettext("A valid domain must be specified."); @@ -124,8 +131,14 @@ if ($_POST) { var_dump(array('fields' => $aliasreqdfields, 'names' => $aliasreqdfieldsn, 'alias' => $alias)); do_input_validation($_POST, $aliasreqdfields, $aliasreqdfieldsn, $input_errors); - if (($alias['host'] && !is_hostname($alias['host']))) { - $input_errors[] = gettext("Hostnames in alias list can only contain the characters A-Z, 0-9 and '-'."); + if ($alias['host']) { + if (!is_hostname($alias['host'])) { + $input_errors[] = gettext("Hostnames in an alias list can only contain the characters A-Z, 0-9 and '-'. They may not start or end with '-'."); + } else { + if (!is_unqualified_hostname($alias['host'])) { + $input_errors[] = gettext("A valid alias hostname is specified, but the domain name part should be omitted"); + } + } } if (($alias['domain'] && !is_domain($alias['domain']))) { $input_errors[] = gettext("A valid domain must be specified in alias list."); |