Fix regression with MatchAny false conditions on match/regex/cidr_match

fixes #6496
This commit is contained in:
Michael Friedrich 2018-07-27 16:55:37 +02:00
parent 1d22b6e176
commit 72c0f07661
1 changed files with 6 additions and 3 deletions

View File

@ -147,7 +147,8 @@ bool ScriptUtils::Regex(const std::vector<Value>& args)
return false;
}
return true;
/* MatchAny: Nothing matched. MatchAll: Everything matched. */
return mode == MatchAll;
} else {
String text = argTexts;
boost::smatch what;
@ -189,7 +190,8 @@ bool ScriptUtils::Match(const std::vector<Value>& args)
return false;
}
return true;
/* MatchAny: Nothing matched. MatchAll: Everything matched. */
return mode == MatchAll;
} else {
String text = argTexts;
return Utility::Match(pattern, argTexts);
@ -230,7 +232,8 @@ bool ScriptUtils::CidrMatch(const std::vector<Value>& args)
return false;
}
return true;
/* MatchAny: Nothing matched. MatchAll: Everything matched. */
return mode == MatchAll;
} else {
String ip = argIps;
return Utility::CidrMatch(pattern, ip);