From 5c4bbaabba19045a0e19651dc35d0a0adf5cb56a Mon Sep 17 00:00:00 2001 From: steve-lad <72376554+steve-lad@users.noreply.github.com> Date: Sun, 18 Jul 2021 12:33:08 +0200 Subject: [PATCH] Ignore $adv_ini if not set Installer and sccp_manager construct - empty variable. Do not use if not set (will be set later) --- sccpManClasses/extconfigs.class.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sccpManClasses/extconfigs.class.php b/sccpManClasses/extconfigs.class.php index 117e569..2dc1940 100644 --- a/sccpManClasses/extconfigs.class.php +++ b/sccpManClasses/extconfigs.class.php @@ -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':