mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-15 23:55:03 +03:00
Fix geolookup operator instantiation
This commit is contained in:
parent
64cbb15335
commit
c5a4355348
@ -59,7 +59,7 @@
|
|||||||
#include "operators/begins_with.h"
|
#include "operators/begins_with.h"
|
||||||
|
|
||||||
#define IF_MATCH(a) \
|
#define IF_MATCH(a) \
|
||||||
if (op.compare(1, op.length() - 2, #a) == 0)
|
if (op_ == #a)
|
||||||
|
|
||||||
namespace ModSecurity {
|
namespace ModSecurity {
|
||||||
namespace operators {
|
namespace operators {
|
||||||
@ -125,6 +125,11 @@ Operator *Operator::instantiate(std::string op_string) {
|
|||||||
p != op.end(); ++p) {
|
p != op.end(); ++p) {
|
||||||
*p = tolower(*p);
|
*p = tolower(*p);
|
||||||
}
|
}
|
||||||
|
std::string op_ = op;
|
||||||
|
if (op_.length() > 2) {
|
||||||
|
op_.erase(0, 1);
|
||||||
|
op_.pop_back();
|
||||||
|
}
|
||||||
|
|
||||||
IF_MATCH(beginswith) { return new BeginsWith(op, param, negation); }
|
IF_MATCH(beginswith) { return new BeginsWith(op, param, negation); }
|
||||||
IF_MATCH(contains) { return new Contains(op, param, negation); }
|
IF_MATCH(contains) { return new Contains(op, param, negation); }
|
||||||
@ -134,7 +139,7 @@ Operator *Operator::instantiate(std::string op_string) {
|
|||||||
IF_MATCH(endswith) { return new EndsWith(op, param, negation); }
|
IF_MATCH(endswith) { return new EndsWith(op, param, negation); }
|
||||||
IF_MATCH(eq) { return new Eq(op, param, negation); }
|
IF_MATCH(eq) { return new Eq(op, param, negation); }
|
||||||
IF_MATCH(fuzzyhash) { return new FuzzyHash(op, param, negation); }
|
IF_MATCH(fuzzyhash) { return new FuzzyHash(op, param, negation); }
|
||||||
IF_MATCH(geolookup) { return new GeoLookup(op, param, negation); }
|
IF_MATCH(geolooku) { return new GeoLookup(op, param, negation); }
|
||||||
IF_MATCH(ge) { return new Ge(op, param, negation); }
|
IF_MATCH(ge) { return new Ge(op, param, negation); }
|
||||||
IF_MATCH(gsblookup) { return new GsbLookup(op, param, negation); }
|
IF_MATCH(gsblookup) { return new GsbLookup(op, param, negation); }
|
||||||
IF_MATCH(gt) { return new Gt(op, param, negation); }
|
IF_MATCH(gt) { return new Gt(op, param, negation); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user