mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-18 02:10:36 +03:00
Refactoring on the operators: negation is now being handled globally
Other minors changes were also made, including adding the prefix `m_' to all the members of the class.
This commit is contained in:
@@ -23,17 +23,13 @@ namespace modsecurity {
|
||||
namespace operators {
|
||||
|
||||
bool Contains::evaluate(Transaction *transaction, const std::string &input) {
|
||||
std::string p = MacroExpansion::expand(param, transaction);
|
||||
std::string p = MacroExpansion::expand(m_param, transaction);
|
||||
bool contains = input.find(p) != std::string::npos;
|
||||
|
||||
if (contains && transaction) {
|
||||
transaction->m_matched.push_back(p);
|
||||
}
|
||||
|
||||
if (negation) {
|
||||
return !contains;
|
||||
}
|
||||
|
||||
return contains;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user