mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 11:44:32 +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:
@@ -26,17 +26,13 @@ namespace operators {
|
||||
|
||||
bool EndsWith::evaluate(Transaction *transaction, const std::string &input) {
|
||||
bool ret = false;
|
||||
std::string p = MacroExpansion::expand(param, transaction);
|
||||
std::string p = MacroExpansion::expand(m_param, transaction);
|
||||
|
||||
if (input.length() >= p.length()) {
|
||||
ret = (0 == input.compare(input.length() - p.length(),
|
||||
p.length(), p));
|
||||
}
|
||||
|
||||
if (negation) {
|
||||
return !ret;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user