Skip to content

Commit

Permalink
Align TIME_MON variable's behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
airween committed Nov 23, 2024
1 parent fd45641 commit db7e4cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/variables/time_mon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void TimeMon::evaluate(Transaction *transaction,
struct tm timeinfo;
localtime_r(&timer, &timeinfo);

transaction->m_variableTimeMin.assign(std::to_string(timeinfo.tm_mon));
transaction->m_variableTimeMin.assign(std::to_string(timeinfo.tm_mon + 1));

l->push_back(new VariableValue(&m_retName,
&transaction->m_variableTimeMin));
Expand Down
3 changes: 2 additions & 1 deletion test/test-cases/regression/variable-TIME_MON.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
]
},
"expected":{
"debug_log":"Target value: \"([0-9]+)\" \\(Variable: TIME_MON\\)"
"http_code": 200,
"debug_log":"Target value: \"[1-9][012]?\" \\(Variable: TIME_MON\\)"
},
"rules":[
"SecRuleEngine On",
Expand Down

0 comments on commit db7e4cb

Please sign in to comment.