Ignore $adv_ini if not set

Installer and sccp_manager construct - empty variable. Do not use if not set (will be set later)
This commit is contained in:
steve-lad 2021-07-18 12:33:08 +02:00
parent 913cbd14c4
commit 5c4bbaabba

View file

@ -305,14 +305,15 @@ class extconfigs
if (file_exists($adv_ini)){
rename($adv_ini, "{$adv_ini}.old");
}
// TODO: index file is not declared
$indexFile = fopen($adv_ini,'w');
fwrite($indexFile, "[main]\n");
foreach ($adv_config as $advKey => $advVal) {
fwrite($indexFile, "{$advKey} = {$advVal}\n");
if (!empty($adv_ini)) {
$indexFile = fopen($adv_ini,'w');
fwrite($indexFile, "[main]\n");
foreach ($adv_config as $advKey => $advVal) {
fwrite($indexFile, "{$advKey} = {$advVal}\n");
}
fclose($indexFile);
$settingsFromDb['tftp_rewrite']['data'] = 'pro';
}
fclose($indexFile);
$settingsFromDb['tftp_rewrite']['data'] = 'pro';
break;
case 'on':
case 'internal':