mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Adds method init to Operator class
This commit is contained in:
@@ -35,11 +35,12 @@ class Operator {
|
||||
param(param),
|
||||
negation(negation) { }
|
||||
|
||||
|
||||
virtual ~Operator() { }
|
||||
std::string op;
|
||||
std::string param;
|
||||
bool negation;
|
||||
|
||||
virtual bool init(const char **error) { return true; }
|
||||
virtual bool evaluate(Assay *assay);
|
||||
virtual bool evaluate(Assay *assay, const std::string &str);
|
||||
static Operator *instantiate(std::string op);
|
||||
|
@@ -261,8 +261,14 @@ expression:
|
||||
audit_log
|
||||
| DIRECTIVE SPACE variables SPACE OPERATOR SPACE QUOTATION_MARK actions QUOTATION_MARK
|
||||
{
|
||||
Operator *op = Operator::instantiate($5);
|
||||
const char *error = NULL;
|
||||
if (op->init(&error) == false) {
|
||||
driver.parserError << error;
|
||||
YYERROR;
|
||||
}
|
||||
Rule *rule = new Rule(
|
||||
/* op */ Operator::instantiate($5),
|
||||
/* op */ op,
|
||||
/* variables */ $3,
|
||||
/* actions */ $8
|
||||
);
|
||||
|
Reference in New Issue
Block a user