mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Using pcre (with JIT) instead of pcrecpp
This commit is contained in:
@@ -29,8 +29,7 @@ namespace operators {
|
||||
bool Rx::evaluate(Assay *assay, const std::string& input) {
|
||||
SMatch match;
|
||||
|
||||
Regex re(MacroExpansion::expand(param, assay));
|
||||
if (regex_search(input, &match, re) && match.size() >= 1) {
|
||||
if (regex_search(input, &match, *m_re) && match.size() >= 1) {
|
||||
this->matched.push_back(match.match);
|
||||
return true;
|
||||
}
|
||||
|
@@ -36,13 +36,17 @@ class Rx : public Operator {
|
||||
/** @ingroup ModSecurity_Operator */
|
||||
Rx(std::string op, std::string param, bool negation)
|
||||
: Operator(op, param, negation),
|
||||
m_param(param) { }
|
||||
m_param(param) {
|
||||
Regex r(param);
|
||||
m_re = &r;
|
||||
}
|
||||
|
||||
bool evaluate(Assay *assay, const std::string &input);
|
||||
|
||||
std::list<std::string> matched;
|
||||
private:
|
||||
std::string m_param;
|
||||
Regex *m_re;
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user