From 15bc83ec14043be167cf5869985e0c4457c4cb25 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Wed, 4 Apr 2018 13:58:19 +0200 Subject: [PATCH] IniParser::parseIniFile(): parse as ::parseIni() would do refs #3357 --- library/Icinga/File/Ini/IniParser.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/Icinga/File/Ini/IniParser.php b/library/Icinga/File/Ini/IniParser.php index 2453d81c9..c19f0ac88 100644 --- a/library/Icinga/File/Ini/IniParser.php +++ b/library/Icinga/File/Ini/IniParser.php @@ -267,6 +267,11 @@ class IniParser throw new ConfigurationError('Couldn\'t parse the INI file `%s\'', $path, $e); } - return Config::fromArray($configArray)->setConfigFile($file); + $unescaped = array(); + foreach ($configArray as $section => $options) { + $unescaped[preg_replace('/\\\\(.)/', '\1', $section)] = $options; + } + + return Config::fromArray($unescaped)->setConfigFile($file); } }