Fix missing config validator for command arguments 'set_if'

fixes #8724
This commit is contained in:
Michael Friedrich 2015-03-12 18:05:58 +01:00
parent 86a1bbf468
commit 7c0749679c
1 changed files with 27 additions and 9 deletions

View File

@ -72,9 +72,26 @@ void Command::ValidateArguments(const String& location, const Command::Ptr& obje
if (arginfo.IsObjectType<Dictionary>()) {
Dictionary::Ptr argdict = arginfo;
if (argdict->Contains("value"))
argval = argdict->Get("value");
} else
if (argdict->Contains("value")) {
String argvalue = argdict->Get("value");
if (!MacroProcessor::ValidateMacroString(argvalue)) {
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
location + ": Closing $ not found in macro format string '" + argvalue + "'.", object->GetDebugInfo()));
}
}
if (argdict->Contains("set_if")) {
String argsetif = argdict->Get("set_if");
if (!MacroProcessor::ValidateMacroString(argsetif)) {
BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
location + ": Closing $ not found in macro format string '" + argsetif + "'.", object->GetDebugInfo()));
}
}
} else if (arginfo.IsObjectType<Function>()) {
continue; /* we cannot evaluate macros in functions */
} else {
argval = arginfo;
if (argval.IsEmpty())
@ -88,6 +105,7 @@ void Command::ValidateArguments(const String& location, const Command::Ptr& obje
}
}
}
}
void Command::ValidateEnvironmentVariables(const String& location, const Command::Ptr& object)
{