mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-15 23:55:03 +03:00
Adds support to the operator le
This commit is contained in:
parent
606f03be43
commit
7b4554216e
@ -22,20 +22,16 @@
|
|||||||
namespace ModSecurity {
|
namespace ModSecurity {
|
||||||
namespace operators {
|
namespace operators {
|
||||||
|
|
||||||
bool Le::evaluate(Assay *assay) {
|
bool Le::evaluate(Assay *assay, const std::string &input) {
|
||||||
/**
|
bool le = atoll(input.c_str()) <= atoll(param.c_str());
|
||||||
* @todo Implement the operator Le.
|
|
||||||
* Reference: https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#le
|
if (negation) {
|
||||||
*/
|
return !le;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return le;
|
||||||
Le::Le(std::string op, std::string param, bool negation)
|
|
||||||
: Operator() {
|
|
||||||
this->op = op;
|
|
||||||
this->param = param;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace operators
|
} // namespace operators
|
||||||
} // namespace ModSecurity
|
} // namespace ModSecurity
|
||||||
|
@ -27,8 +27,10 @@ namespace operators {
|
|||||||
class Le : public Operator {
|
class Le : public Operator {
|
||||||
public:
|
public:
|
||||||
/** @ingroup ModSecurity_Operator */
|
/** @ingroup ModSecurity_Operator */
|
||||||
Le(std::string o, std::string p, bool i);
|
Le(std::string op, std::string param, bool negation)
|
||||||
bool evaluate(Assay *assay);
|
: Operator(op, param, negation) { }
|
||||||
|
|
||||||
|
bool evaluate(Assay *assay, const std::string &input) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user