From f6e42fc631acad20006ad79f63ccecc0a86ad0eb Mon Sep 17 00:00:00 2001 From: Marius Cramer <m.cramer@pixcept.de> Date: Thu, 07 May 2015 11:26:41 -0400 Subject: [PATCH] Merge branch 'master' into 'master' --- install/install.php | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/install/install.php b/install/install.php index 447d793..12e0178 100644 --- a/install/install.php +++ b/install/install.php @@ -171,8 +171,16 @@ //** Get the hostname $tmp_out = array(); exec('hostname -f', $tmp_out); -$conf['hostname'] = $inst->free_query('Full qualified hostname (FQDN) of the server, eg server1.domain.tld ', @$tmp_out[0],'hostname'); +$conf['hostname'] = @$tmp_out[0]; unset($tmp_out); +//** Prevent empty hostname +$check = false; +do { + $conf['hostname'] = $inst->free_query('Full qualified hostname (FQDN) of the server, eg server1.domain.tld ', $conf['hostname'], 'hostname'); + $conf['hostname']=trim($conf['hostname']); + $check = @($conf['hostname'] !== '')?true:false; + if(!$check) swriteln('Hostname may not be empty.'); +} while (!$check); // Check if the mysql functions are loaded in PHP if(!function_exists('mysql_connect')) die('No PHP MySQL functions available. Please ensure that the PHP MySQL module is loaded.'); -- Gitblit v1.9.1