mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-10-02 04:27:47 +03:00
Adds support to the @streq operator
This commit is contained in:
@@ -21,19 +21,15 @@ namespace ModSecurity {
|
||||
namespace operators {
|
||||
|
||||
bool StrEq::evaluate(Assay *assay, const std::string &str) {
|
||||
/**
|
||||
* @todo Implement the operator StrEq.
|
||||
* Reference: https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#streq
|
||||
*/
|
||||
return !this->param.compare(str);
|
||||
bool eq = !this->param.compare(str);
|
||||
|
||||
if (negation) {
|
||||
return !eq;
|
||||
}
|
||||
|
||||
return eq;
|
||||
}
|
||||
|
||||
|
||||
StrEq::StrEq(std::string op, std::string param, bool negation)
|
||||
: Operator() {
|
||||
this->op = op;
|
||||
this->param = param;
|
||||
}
|
||||
|
||||
} // namespace operators
|
||||
} // namespace ModSecurity
|
||||
|
Reference in New Issue
Block a user