mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 11:44:32 +03:00
Adds reference to filename and line number to lexer errors
This commit is contained in:
@@ -68,6 +68,16 @@ Phase::Phase(std::string action)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool Phase::init(std::string *error) {
|
||||
if (phase >= ModSecurity::Phases::NUMBER_OF_PHASES) {
|
||||
error->assign("Unknown phase: " + std::to_string(phase));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Phase::evaluate(Rule *rule, Assay *assay) {
|
||||
rule->phase = this->phase;
|
||||
return true;
|
||||
|
@@ -34,6 +34,7 @@ class Phase : public Action {
|
||||
public:
|
||||
explicit Phase(std::string action);
|
||||
|
||||
bool init(std::string *error) override;
|
||||
bool evaluate(Rule *rule, Assay *assay) override;
|
||||
int phase;
|
||||
int m_secRulesPhase;
|
||||
|
Reference in New Issue
Block a user