From a34f17f83970f4bfb04e6c80188ca36a29125dd2 Mon Sep 17 00:00:00 2001 From: Patrick Nelson Date: Fri, 12 Feb 2016 00:25:01 -0500 Subject: [PATCH] FIX for #5028: Ensure empty YML configs don't break when merging them in (i.e. make sure it's traversable before foreach'ing over it). --- core/manifest/ConfigManifest.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/manifest/ConfigManifest.php b/core/manifest/ConfigManifest.php index 22e6dd51e..af04ae9e9 100644 --- a/core/manifest/ConfigManifest.php +++ b/core/manifest/ConfigManifest.php @@ -652,8 +652,10 @@ class SS_ConfigManifest { * @return void */ public function mergeInYamlFragment(&$into, $fragment) { - foreach ($fragment as $k => $v) { - Config::merge_high_into_low($into[$k], $v); + if (is_array($fragment) || ($fragment instanceof Traversable)) { + foreach ($fragment as $k => $v) { + Config::merge_high_into_low($into[$k], $v); + } } }