mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-18 02:10:36 +03:00
Makes operator to use string_view
This commit is contained in:
@@ -71,7 +71,7 @@ namespace operators {
|
||||
|
||||
|
||||
bool Operator::evaluateInternal(Transaction *transaction,
|
||||
RuleWithActions *rule, const std::string& a, RuleMessage *rm) {
|
||||
RuleWithActions *rule, const bpstd::string_view &a, RuleMessage *rm) {
|
||||
bool res = evaluate(transaction, rule, a, rm);
|
||||
|
||||
if (m_negation) {
|
||||
@@ -81,28 +81,6 @@ bool Operator::evaluateInternal(Transaction *transaction,
|
||||
return res;
|
||||
}
|
||||
|
||||
bool Operator::evaluateInternal(Transaction *transaction,
|
||||
RuleWithActions *rule, const std::string& a) {
|
||||
bool res = evaluate(transaction, rule, a);
|
||||
|
||||
if (m_negation) {
|
||||
return !res;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
bool Operator::evaluateInternal(Transaction *transaction,
|
||||
const std::string& a) {
|
||||
bool res = evaluate(transaction, a);
|
||||
|
||||
if (m_negation) {
|
||||
return !res;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
std::string Operator::resolveMatchMessage(Transaction *t,
|
||||
std::string key, std::string value) {
|
||||
@@ -132,7 +110,10 @@ std::string Operator::resolveMatchMessage(Transaction *t,
|
||||
}
|
||||
|
||||
|
||||
bool Operator::evaluate(Transaction *transaction, const std::string& a) {
|
||||
bool Operator::evaluate(Transaction *transaction,
|
||||
RuleWithActions *rule,
|
||||
const bpstd::string_view &input,
|
||||
RuleMessage *ruleMessage) {
|
||||
ms_dbg_a(transaction, 2, "Operator: " + m_op + \
|
||||
" is not implemented or malfunctioning.");
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user