mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 13:56:01 +03:00
Correction remove_by_tag and remove_by_msg
This commit is contained in:
parent
5e8062cf72
commit
a0bea7356d
15
src/rules.cc
15
src/rules.cc
@ -152,6 +152,8 @@ std::string Rules::getParserError() {
|
||||
|
||||
|
||||
int Rules::evaluate(int phase, Transaction *transaction) {
|
||||
bool remove_rule;
|
||||
|
||||
if (phase > modsecurity::Phases::NUMBER_OF_PHASES) {
|
||||
return 0;
|
||||
}
|
||||
@ -178,6 +180,7 @@ int Rules::evaluate(int phase, Transaction *transaction) {
|
||||
}
|
||||
|
||||
for (int i = 0; i < rules.size(); i++) {
|
||||
remove_rule = false;
|
||||
Rule *rule = rules[i];
|
||||
if (transaction->m_marker.empty() == false) {
|
||||
debug(9, "Skipped rule id '" + std::to_string(rule->m_ruleId) \
|
||||
@ -209,9 +212,13 @@ int Rules::evaluate(int phase, Transaction *transaction) {
|
||||
debug(9, "Skipped rule id '" \
|
||||
+ std::to_string(rule->m_ruleId) \
|
||||
+ "'. Removed by a SecRuleRemoveByMsg directive.");
|
||||
return 1;
|
||||
remove_rule = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(remove_rule) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_exceptions.m_remove_rule_by_tag.empty() == false) {
|
||||
@ -220,9 +227,13 @@ int Rules::evaluate(int phase, Transaction *transaction) {
|
||||
debug(9, "Skipped rule id '" \
|
||||
+ std::to_string(rule->m_ruleId) \
|
||||
+ "'. Removed by a SecRuleRemoveByTag directive.");
|
||||
return 1;
|
||||
remove_rule = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(remove_rule) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
rule->evaluate(transaction, NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user