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_unbound_host_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_unbound_host_edit.php')
-rw-r--r-- | usr/local/www/services_unbound_host_edit.php | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/usr/local/www/services_unbound_host_edit.php b/usr/local/www/services_unbound_host_edit.php index 7c3db7d..5ebf9ae 100644 --- a/usr/local/www/services_unbound_host_edit.php +++ b/usr/local/www/services_unbound_host_edit.php @@ -1,7 +1,7 @@ <?php /* $Id$ */ /* - services_unbound_edit_host.php + services_unbound_host_edit.php part of the pfSense project (https://www.pfsense.org) Copyright (C) 2014 Warren Baker (warren@decoy.co.za) Copyright (C) 2013-2014 Electric Sheep Fencing, LP @@ -88,8 +88,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."); @@ -126,8 +133,15 @@ 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."); } |