From 41fe069fe9f44753c428447ba5965a010e8e1f63 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 1 Mar 2023 12:30:59 +0100 Subject: [PATCH] Config: fix set() method --- src/Config.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Config.php b/src/Config.php index 886eb7b..94cc442 100644 --- a/src/Config.php +++ b/src/Config.php @@ -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; }