summaryrefslogtreecommitdiffstats
path: root/usr/local/www/system.php
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-11-18 07:46:56 -0200
committerRenato Botelho <garga@FreeBSD.org>2014-11-18 07:46:56 -0200
commit8a5265b212bcd4518c9dbb74c30408c89709a1b5 (patch)
treed6295b60f47c7043e3bbe96d086482662ab15adb /usr/local/www/system.php
parenta0b72ec3700fae82a0fd42f28b29bdd2bf274ce7 (diff)
parentda66ef4f93161efffa53f62a59bb1cbdf5e1f41b (diff)
downloadpfsense-8a5265b212bcd4518c9dbb74c30408c89709a1b5.zip
pfsense-8a5265b212bcd4518c9dbb74c30408c89709a1b5.tar.gz
Merge pull request #1332 from phil-davis/patch-3
Diffstat (limited to 'usr/local/www/system.php')
-rw-r--r--usr/local/www/system.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr/local/www/system.php b/usr/local/www/system.php
index 31845c2..1329e8d 100644
--- a/usr/local/www/system.php
+++ b/usr/local/www/system.php
@@ -109,8 +109,14 @@ if ($_POST) {
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
- if ($_POST['hostname'] && !is_hostname($_POST['hostname'])) {
- $input_errors[] = gettext("The hostname may only contain the characters a-z, 0-9 and '-'.");
+ if ($_POST['hostname']) {
+ if (!is_hostname($_POST['hostname'])) {
+ $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['hostname'])) {
+ $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("The domain may only contain the characters a-z, 0-9, '-' and '.'.");
OpenPOWER on IntegriCloud