From: Marcin Haba Date: Thu, 11 Jan 2024 13:42:41 +0000 (+0100) Subject: baculum: Tweak improve directive filter in config endpoints X-Git-Tag: Beta-15.0.1~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=917fec8a568fff432c984eeb9f62f13a6895adb3;p=thirdparty%2Fbacula.git baculum: Tweak improve directive filter in config endpoints --- diff --git a/gui/baculum/protected/API/Modules/BaculaConfig.php b/gui/baculum/protected/API/Modules/BaculaConfig.php index 7d4845ee1..0b269718f 100644 --- a/gui/baculum/protected/API/Modules/BaculaConfig.php +++ b/gui/baculum/protected/API/Modules/BaculaConfig.php @@ -125,9 +125,13 @@ class BaculaConfig extends ConfigFileModule { $assoc_keys = array_filter(array_keys($config), 'is_string'); if (count($config) > 0 && count($assoc_keys) > 0) { // It works only with list of resources, not with single resource - return $config; + return []; } $cond = explode('.', $key); + if (count($cond) < 2) { + // It does not work with values in first nest + return []; + } $nest_idx = 0; $config_new = []; for ($i = 0; $i < count($config); $i++) {