Config: fix set() method

This commit is contained in:
Benjamin Renard 2023-03-01 12:30:59 +01:00
parent 21b425e32b
commit 41fe069fe9
Signed by: bn8
GPG key ID: 3E2E1CE1907115BC

View file

@ -222,10 +222,10 @@ Class Config {
for ($i=0; $i < count($exploded_key) - 1; $i++) {
$k = $exploded_key[$i];
if (!array_key_exists($k, $config))
$config[$k] = array();
$config = &$config[$k];
$parent[$k] = array();
$parent = &$parent[$k];
}
$config[array_pop($exploded_key)] = $value;
$parent[array_pop($exploded_key)] = $value;
return true;
}