]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Tweak improve directive filter in config endpoints
authorMarcin Haba <marcin.haba@bacula.pl>
Thu, 11 Jan 2024 13:42:41 +0000 (14:42 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Thu, 18 Jan 2024 09:22:38 +0000 (10:22 +0100)
gui/baculum/protected/API/Modules/BaculaConfig.php

index 7d4845ee1d1486ad526fa5c288d0b592f54d6099..0b269718f877a0bd729ab9c9ac3aca81c37793af 100644 (file)
@@ -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++) {