mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-13 13:26:01 +03:00
Revert "support macro expansion in @rx"
This reverts commit a76030256ea914ca7bedf1a6636b4a3e3afa8713.
This commit is contained in:
parent
c0c19e3a99
commit
f9abf279e2
@ -33,19 +33,12 @@ bool Rx::evaluate(Transaction *transaction, Rule *rule,
|
||||
const std::string& input, std::shared_ptr<RuleMessage> ruleMessage) {
|
||||
SMatch match;
|
||||
std::list<SMatch> matches;
|
||||
Regex * re = m_re;
|
||||
|
||||
if (m_param.empty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string eparam = MacroExpansion::expand(m_param, transaction);
|
||||
|
||||
if (eparam != m_param) {
|
||||
re = new Regex(eparam);
|
||||
}
|
||||
|
||||
matches = re->searchAll(input);
|
||||
matches = m_re->searchAll(input);
|
||||
if (rule && rule->getActionsByName("capture").size() > 0 && transaction) {
|
||||
int i = 0;
|
||||
matches.reverse();
|
||||
@ -65,10 +58,6 @@ bool Rx::evaluate(Transaction *transaction, Rule *rule,
|
||||
logOffset(ruleMessage, i.m_offset, i.m_length);
|
||||
}
|
||||
|
||||
if (re != m_re) {
|
||||
delete re;
|
||||
}
|
||||
|
||||
if (matches.size() > 0) {
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user