From 91fd7d1cfa8a3cfac8e9e988b911821844e1fa39 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Mon, 20 Sep 2021 15:20:25 +0100 Subject: [PATCH] [CONFIG][CORE] Fix bug in overriding default config --- src/Core/GNUsocial.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Core/GNUsocial.php b/src/Core/GNUsocial.php index e4899145e5..1807a98903 100644 --- a/src/Core/GNUsocial.php +++ b/src/Core/GNUsocial.php @@ -235,7 +235,7 @@ class GNUsocial implements EventSubscriberInterface // Overriding doesn't work as we want, overrides the top-most key, do it manually $local_file = INSTALLDIR . '/social.local.yaml'; if (!file_exists($local_file)) { - file_put_contents($local_file, "parameters:\n locals:\n gnusocial:\n"); + file_put_contents($local_file, "parameters:\n locals:\n gnusocial:\n"); } // Load .local @@ -255,7 +255,7 @@ class GNUsocial implements EventSubscriberInterface $wrapper = $container->hasParameter($to) ? $container->getParameter($to) : []; $content = [$from => $container->getParameter($from)]; $container->getParameterBag()->remove($from); - $locals = isset($locals[$from]) ? [$from => $locals[$from]] : []; + $locals = $locals[$from] ?? []; $configs = array_replace_recursive($wrapper, $content, $locals); $container->setParameter($to, $configs); };