mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 11:44:32 +03:00
Correct the usage of modsecurity::Phases::NUMBER_OF_PHASES
This commit is contained in:
committed by
Felipe Zimmerle
parent
ce3abf2626
commit
3b3004d24d
@@ -51,6 +51,9 @@ bool Phase::init(std::string *error) {
|
||||
} else if (m_phase == 5) {
|
||||
m_phase = modsecurity::Phases::LoggingPhase;
|
||||
m_secRulesPhase = 5;
|
||||
} else {
|
||||
error->assign("Unknown phase: " + m_parser_payload);
|
||||
return false;
|
||||
}
|
||||
} catch (...) {
|
||||
if (a == "request") {
|
||||
@@ -64,16 +67,6 @@ bool Phase::init(std::string *error) {
|
||||
m_secRulesPhase = 5;
|
||||
}
|
||||
}
|
||||
if (m_phase == -1) {
|
||||
error->assign("Not able to associate the given rule to any phase: " + \
|
||||
m_parser_payload);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_phase > modsecurity::Phases::NUMBER_OF_PHASES) {
|
||||
error->assign("Unknown phase: " + std::to_string(m_phase));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user