diff --git a/emhttp/plugins/dynamix/include/Wrappers.php b/emhttp/plugins/dynamix/include/Wrappers.php index b430ee17f..8d446563b 100644 --- a/emhttp/plugins/dynamix/include/Wrappers.php +++ b/emhttp/plugins/dynamix/include/Wrappers.php @@ -52,8 +52,24 @@ function parse_plugin_cfg($plugin, $sections=false, $scanner=INI_SCANNER_NORMAL) global $docroot; $ram = "$docroot/plugins/$plugin/default.cfg"; $rom = "/boot/config/plugins/$plugin/$plugin.cfg"; - $cfg = file_exists($ram) ? my_parse_ini_file($ram, $sections, $scanner) : []; - return file_exists($rom) ? array_replace_recursive($cfg, my_parse_ini_file($rom, $sections, $scanner)) : $cfg; + + $cfg_ram = []; + if (file_exists($ram)) { + $cfg_ram = my_parse_ini_file($ram, $sections, $scanner); + if ($cfg_ram === false) { + my_logger("Failed to parse config file: $ram", 'webgui'); + $cfg_ram = []; + } + } + $cfg_rom = []; + if (file_exists($rom)) { + $cfg_rom = my_parse_ini_file($rom, $sections, $scanner); + if ($cfg_rom === false) { + my_logger("Failed to parse config file: $rom", 'webgui'); + $cfg_rom = []; + } + } + return !empty($cfg_rom) ? array_replace_recursive($cfg_ram, $cfg_rom) : $cfg_ram; } function parse_cron_cfg($plugin, $job, $text = "") {