From ee405d849b027618eec69425ed845afdc076b562 Mon Sep 17 00:00:00 2001
From: Florian Schaal <florian@schaal-24.de>
Date: Wed, 06 May 2015 10:08:15 -0400
Subject: [PATCH] Prevent empty hostname during install

---
 install/install.php |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/install/install.php b/install/install.php
index 447d793..a8e2abc 100644
--- a/install/install.php
+++ b/install/install.php
@@ -174,6 +174,18 @@
 $conf['hostname'] = $inst->free_query('Full qualified hostname (FQDN) of the server, eg server1.domain.tld ', @$tmp_out[0],'hostname');
 unset($tmp_out);
 
+//** Prevent empty hostname
+$conf['hostname']=trim($conf['hostname']);
+if($conf['hostname'] === '') {
+	$check = false;
+	do {
+		swriteln('Hostname may not be empty.');
+		$conf['hostname'] = $inst->free_query('Full qualified hostname (FQDN) of the server, eg server1.domain.tld ', '', 'hostname');
+		$conf['hostname']=trim($conf['hostname']);
+		$check = @($conf['hostname'] !== '')?true:false;
+	} 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.');
 
@@ -861,4 +873,4 @@
 echo "Installation completed.\n";
 
 
-?>
\ No newline at end of file
+?>

--
Gitblit v1.9.1