summaryrefslogtreecommitdiffstats
path: root/usr/local/www/system.php
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2014-11-11 00:22:23 +0545
committerPhil Davis <phil.davis@inf.org>2014-11-11 00:22:23 +0545
commit2d86ee9554090aba799c51dcf0861e894799de67 (patch)
treebda424abc2a4b72c0f0ec6bc5540c4abd3b9c2fa /usr/local/www/system.php
parent762fc5c06b90930db764f38b1f94e8e4a38a927c (diff)
downloadpfsense-2d86ee9554090aba799c51dcf0861e894799de67.zip
pfsense-2d86ee9554090aba799c51dcf0861e894799de67.tar.gz
Stop FQDN in hostname field
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 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 '.'.");
OpenPOWER on IntegriCloud