Makes operator to use string_view

This commit is contained in:
Felipe Zimmerle
2019-03-05 12:26:44 -03:00
parent d5158f1afc
commit 301f724e9e
85 changed files with 1954 additions and 298 deletions

View File

@@ -21,10 +21,12 @@
namespace modsecurity {
namespace operators {
bool Contains::evaluate(Transaction *transaction, RuleWithActions *rule,
const std::string &input, RuleMessage *ruleMessage) {
bool Contains::evaluate(Transaction *transaction,
RuleWithActions *rule,
const bpstd::string_view &input,
RuleMessage *ruleMessage) {
std::string p(m_string->evaluate(transaction));
size_t offset = input.find(p);
size_t offset = input.to_string().find(p);
bool contains = offset != std::string::npos;