mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Creates the RulesSetPhases clas
This commit is contained in:
@@ -110,7 +110,7 @@ int RulesSet::evaluate(int phase, Transaction *t) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::vector<Rule *> rules = m_rules[phase];
|
||||
std::vector<Rule *> rules = m_rulesSetPhases[phase];
|
||||
|
||||
ms_dbg_a(t, 9, "This phase consists of " \
|
||||
+ std::to_string(rules.size()) + " rule(s).");
|
||||
@@ -222,7 +222,10 @@ int RulesSet::evaluate(int phase, Transaction *t) {
|
||||
|
||||
int RulesSet::merge(Driver *from) {
|
||||
int amount_of_rules = 0;
|
||||
amount_of_rules = mergeProperties(
|
||||
|
||||
amount_of_rules = m_rulesSetPhases.append(&from->m_rulesSetPhases,
|
||||
&m_parserError);
|
||||
mergeProperties(
|
||||
dynamic_cast<RulesSetProperties *>(from),
|
||||
dynamic_cast<RulesSetProperties *>(this),
|
||||
&m_parserError);
|
||||
@@ -233,7 +236,10 @@ int RulesSet::merge(Driver *from) {
|
||||
|
||||
int RulesSet::merge(RulesSet *from) {
|
||||
int amount_of_rules = 0;
|
||||
amount_of_rules = mergeProperties(
|
||||
|
||||
amount_of_rules = m_rulesSetPhases.append(&from->m_rulesSetPhases,
|
||||
&m_parserError);
|
||||
mergeProperties(
|
||||
dynamic_cast<RulesSetProperties *>(from),
|
||||
dynamic_cast<RulesSetProperties *>(this),
|
||||
&m_parserError);
|
||||
@@ -254,7 +260,7 @@ void RulesSet::debug(int level, const std::string &id,
|
||||
void RulesSet::dump() const {
|
||||
std::cout << "Rules: " << std::endl;
|
||||
for (int i = 0; i < modsecurity::Phases::NUMBER_OF_PHASES; i++) {
|
||||
std::vector<Rule *> rules = m_rules[i];
|
||||
std::vector<Rule *> rules = m_rulesSetPhases[i];
|
||||
std::cout << "Phase: " << std::to_string(i);
|
||||
std::cout << " (" << std::to_string(rules.size());
|
||||
std::cout << " rules)" << std::endl;
|
||||
|
Reference in New Issue
Block a user