mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-16 07:56:12 +03:00
Adds support to the operator gt
This commit is contained in:
parent
235bf9c010
commit
606f03be43
@ -22,20 +22,16 @@
|
|||||||
namespace ModSecurity {
|
namespace ModSecurity {
|
||||||
namespace operators {
|
namespace operators {
|
||||||
|
|
||||||
bool Lt::evaluate(Assay *assay) {
|
bool Lt::evaluate(Assay *assay, const std::string &input) {
|
||||||
/**
|
bool lt = atoll(input.c_str()) < atoll(param.c_str());
|
||||||
* @todo Implement the operator Lt.
|
|
||||||
* Reference: https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#lt
|
if (negation) {
|
||||||
*/
|
return !lt;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return lt;
|
||||||
Lt::Lt(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 Lt : public Operator {
|
class Lt : public Operator {
|
||||||
public:
|
public:
|
||||||
/** @ingroup ModSecurity_Operator */
|
/** @ingroup ModSecurity_Operator */
|
||||||
Lt(std::string o, std::string p, bool i);
|
Lt(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;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace operators
|
} // namespace operators
|
||||||
|
Loading…
x
Reference in New Issue
Block a user