mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Adds contains to the list of operators compatibles with the capture action
This commit is contained in:
@@ -23,6 +23,10 @@ namespace operators {
|
||||
bool Contains::evaluate(Assay *assay, const std::string &input) {
|
||||
bool contains = input.find(param) != std::string::npos;
|
||||
|
||||
if (contains) {
|
||||
matched.push_back(param);
|
||||
}
|
||||
|
||||
if (negation) {
|
||||
return !contains;
|
||||
}
|
||||
|
@@ -31,6 +31,8 @@ class Contains : public Operator {
|
||||
Contains(std::string op, std::string param, bool negation)
|
||||
: Operator(op, param, negation) { }
|
||||
bool evaluate(Assay *assay, const std::string &exp) override;
|
||||
|
||||
std::list<std::string> matched;
|
||||
};
|
||||
|
||||
} // namespace operators
|
||||
|
Reference in New Issue
Block a user