Don't validate custom attributes that aren't strings

fixes #10539
This commit is contained in:
Gunnar Beutner 2015-11-04 19:04:33 +01:00
parent fe1c5e9507
commit 09b2b054f5
1 changed files with 5 additions and 7 deletions

View File

@ -368,7 +368,7 @@ void MacroProcessor::ValidateCustomVars(const ConfigObject::Ptr& object, const D
ObjectLock xlock(varval_dict);
BOOST_FOREACH(const Dictionary::Pair& kv_var, varval_dict) {
if (kv_var.second.IsEmpty())
if (!kv_var.second.IsString())
continue;
if (!ValidateMacroString(kv_var.second))
@ -380,7 +380,7 @@ void MacroProcessor::ValidateCustomVars(const ConfigObject::Ptr& object, const D
ObjectLock ylock (varval_arr);
BOOST_FOREACH(const Value& arrval, varval_arr) {
if (arrval.IsEmpty())
if (!arrval.IsString())
continue;
if (!ValidateMacroString(arrval)) {
@ -388,13 +388,11 @@ void MacroProcessor::ValidateCustomVars(const ConfigObject::Ptr& object, const D
}
}
} else {
if (varval.IsEmpty())
if (!varval.IsString())
continue;
String varstr = varval;
if (!ValidateMacroString(varstr))
BOOST_THROW_EXCEPTION(ValidationError(object.get(), boost::assign::list_of<String>("vars")(kv.first), "Closing $ not found in macro format string '" + varstr + "'."));
if (!ValidateMacroString(varval))
BOOST_THROW_EXCEPTION(ValidationError(object.get(), boost::assign::list_of<String>("vars")(kv.first), "Closing $ not found in macro format string '" + varval + "'."));
}
}
}