]> granicus.if.org Git - icinga2/commitdiff
Fix arrays in command arguments
authorGunnar Beutner <gunnar@beutner.name>
Thu, 26 Mar 2015 08:29:52 +0000 (09:29 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Thu, 26 Mar 2015 08:44:47 +0000 (09:44 +0100)
fixes #8869

lib/icinga/macroprocessor.cpp

index 77a3aeafc5d77a67151dc2c4cec8e6219ddcfd97..625a4169e3bf38a4b2eaa6d67e4b4fab32f9a631 100644 (file)
@@ -54,8 +54,13 @@ Value MacroProcessor::ResolveMacros(const Value& str, const ResolverList& resolv
 
                BOOST_FOREACH(const Value& arg, arr) {
                        /* Note: don't escape macros here. */
-                       resultArr->Add(InternalResolveMacros(arg, resolvers, cr, missingMacro,
-                           EscapeCallback(), resolvedMacros, useResolvedMacros));
+                       Value value = InternalResolveMacros(arg, resolvers, cr, missingMacro,
+                           EscapeCallback(), resolvedMacros, useResolvedMacros);
+
+                       if (value.IsObjectType<Array>())
+                               resultArr->Add(Utility::Join(value, ';'));
+                       else
+                               resultArr->Add(value);
                }
 
                result = resultArr;