Skip to content

Commit bb690d4

Browse files
author
Florian Schaal
committed
updated avoid the second use of query in install.php
1 parent 7eade0d commit bb690d4

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

install/install.php

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -171,21 +171,16 @@
171171
//** Get the hostname
172172
$tmp_out = array();
173173
exec('hostname -f', $tmp_out);
174-
$conf['hostname'] = $inst->free_query('Full qualified hostname (FQDN) of the server, eg server1.domain.tld ', @$tmp_out[0],'hostname');
175-
176-
//** Prevent empty hostname
177-
$conf['hostname']=trim(@$tmp_out[0]);
174+
$conf['hostname']=$tmp_out[0];
178175
unset($tmp_out);
179-
180-
if($conf['hostname'] === '') {
181-
$check = false;
182-
do {
183-
swriteln('Hostname may not be empty.');
184-
$conf['hostname'] = $inst->free_query('Full qualified hostname (FQDN) of the server, eg server1.domain.tld ', '', 'hostname');
185-
$conf['hostname']=trim($conf['hostname']);
186-
$check = @($conf['hostname'] !== '')?true:false;
187-
} while (!$check);
188-
}
176+
//** Prevent empty hostname
177+
$check = false;
178+
do {
179+
$conf['hostname'] = $inst->free_query('Full qualified hostname (FQDN) of the server, eg server1.domain.tld ', $conf['hostname'], 'hostname');
180+
$conf['hostname']=trim($conf['hostname']);
181+
$check = @($conf['hostname'] !== '')?true:false;
182+
if(!$check) swriteln('Hostname may not be empty.');
183+
} while (!$check);
189184

190185
// Check if the mysql functions are loaded in PHP
191186
if(!function_exists('mysql_connect')) die('No PHP MySQL functions available. Please ensure that the PHP MySQL module is loaded.');

0 commit comments

Comments
 (0)