Handle unexpected os when loading yaml (#9790)

This commit is contained in:
Tony Murray
2019-02-06 14:24:39 -06:00
committed by GitHub
parent 61a48fbdd2
commit 8d3a3c9a3e

View File

@ -1601,12 +1601,14 @@ function load_all_os($existing = false, $cached = true)
} }
foreach ($os_list as $file) { foreach ($os_list as $file) {
$tmp = Symfony\Component\Yaml\Yaml::parse(file_get_contents($file)); if (is_readable($file)) {
$tmp = Symfony\Component\Yaml\Yaml::parse(file_get_contents($file));
if (isset($config['os'][$tmp['os']])) { if (isset($config['os'][$tmp['os']])) {
$config['os'][$tmp['os']] = array_replace_recursive($tmp, $config['os'][$tmp['os']]); $config['os'][$tmp['os']] = array_replace_recursive($tmp, $config['os'][$tmp['os']]);
} else { } else {
$config['os'][$tmp['os']] = $tmp; $config['os'][$tmp['os']] = $tmp;
}
} }
} }
} }