mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-15 23:55:03 +03:00
Adds support to the @streq operator
This commit is contained in:
parent
35901c1ebe
commit
170cb60c82
@ -21,19 +21,15 @@ namespace ModSecurity {
|
|||||||
namespace operators {
|
namespace operators {
|
||||||
|
|
||||||
bool StrEq::evaluate(Assay *assay, const std::string &str) {
|
bool StrEq::evaluate(Assay *assay, const std::string &str) {
|
||||||
/**
|
bool eq = !this->param.compare(str);
|
||||||
* @todo Implement the operator StrEq.
|
|
||||||
* Reference: https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#streq
|
if (negation) {
|
||||||
*/
|
return !eq;
|
||||||
return !this->param.compare(str);
|
}
|
||||||
|
|
||||||
|
return eq;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
StrEq::StrEq(std::string op, std::string param, bool negation)
|
|
||||||
: Operator() {
|
|
||||||
this->op = op;
|
|
||||||
this->param = param;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace operators
|
} // namespace operators
|
||||||
} // namespace ModSecurity
|
} // namespace ModSecurity
|
||||||
|
@ -30,7 +30,9 @@ namespace operators {
|
|||||||
class StrEq : public Operator {
|
class StrEq : public Operator {
|
||||||
public:
|
public:
|
||||||
/** @ingroup ModSecurity_Operator */
|
/** @ingroup ModSecurity_Operator */
|
||||||
StrEq(std::string o, std::string p, bool i);
|
StrEq(std::string op, std::string param, bool negation)
|
||||||
|
: Operator(op, param, negation) { }
|
||||||
|
|
||||||
bool evaluate(Assay *assay, const std::string &str) override;
|
bool evaluate(Assay *assay, const std::string &str) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user