Adds support to the operator gt

This commit is contained in:
Felipe Zimmerle 2015-07-27 16:15:34 -03:00
parent 170cb60c82
commit 235bf9c010
2 changed files with 12 additions and 15 deletions

View File

@ -22,21 +22,16 @@
namespace ModSecurity { namespace ModSecurity {
namespace operators { namespace operators {
bool Gt::evaluate(Assay *assay) { bool Gt::evaluate(Assay *assay, const std::string &input) {
/** bool gt = atoll(input.c_str()) > atoll(param.c_str());
* @todo Implement the operator Gt.
* Reference: https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#gt if (negation) {
*/ return !gt;
return true; }
return gt;
} }
Gt::Gt(std::string op, std::string param,
bool negation)
: Operator() {
this->op = op;
this->param = param;
}
} // namespace operators } // namespace operators
} // namespace ModSecurity } // namespace ModSecurity

View File

@ -27,8 +27,10 @@ namespace operators {
class Gt : public Operator { class Gt : public Operator {
public: public:
/** @ingroup ModSecurity_Operator */ /** @ingroup ModSecurity_Operator */
Gt(std::string o, std::string p, bool i); Gt(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