diff options
author | Phil Davis <phil.davis@inf.org> | 2014-11-11 00:22:23 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2014-11-11 00:22:23 +0545 |
commit | 2d86ee9554090aba799c51dcf0861e894799de67 (patch) | |
tree | bda424abc2a4b72c0f0ec6bc5540c4abd3b9c2fa | |
parent | 762fc5c06b90930db764f38b1f94e8e4a38a927c (diff) | |
download | pfsense-2d86ee9554090aba799c51dcf0861e894799de67.zip pfsense-2d86ee9554090aba799c51dcf0861e894799de67.tar.gz |
Stop FQDN in hostname field
-rw-r--r-- | usr/local/www/system.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/usr/local/www/system.php b/usr/local/www/system.php index c5cfe52..dfe3884 100644 --- a/usr/local/www/system.php +++ b/usr/local/www/system.php @@ -108,8 +108,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 '.'."); |