From 626c3494e48d600adc21fbfd33d4ffa2f17e7541 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Tue, 22 Sep 2015 14:46:15 +0200 Subject: [PATCH] Config::fromIni(): use IniParser::parseIniFile() instead of parse_ini_file() refs #10150 --- library/Icinga/Application/Config.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Application/Config.php b/library/Icinga/Application/Config.php index 0538f01d4..d7bfe64a6 100644 --- a/library/Icinga/Application/Config.php +++ b/library/Icinga/Application/Config.php @@ -12,6 +12,7 @@ use Icinga\Data\ConfigObject; use Icinga\Data\Selectable; use Icinga\Data\SimpleQuery; use Icinga\File\Ini\IniWriter; +use Icinga\File\Ini\IniParser; use Icinga\Exception\NotReadableError; /** @@ -313,7 +314,7 @@ class Config implements Countable, Iterator, Selectable if ($filepath === false) { $emptyConfig->setConfigFile($file); } elseif (is_readable($filepath)) { - $config = new static(new ConfigObject(parse_ini_file($filepath, true))); + $config = static::fromArray(IniParser::parseIniFile($filepath)->toArray()); $config->setConfigFile($filepath); return $config; } elseif (@file_exists($filepath)) {