Merge pull request #3306 from airween/v3/time_mon_fix

fix: align TIME_MON variable's behavior
This commit is contained in:
Ervin Hegedus 2024-11-24 16:28:47 +00:00 committed by GitHub
commit d9101a4fe1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -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));

View File

@ -33,7 +33,8 @@
]
},
"expected":{
"debug_log":"Target value: \"([0-9]+)\" \\(Variable: TIME_MON\\)"
"http_code": 200,
"debug_log":"Target value: \"([1-9]|1[012])\" \\(Variable: TIME_MON\\)"
},
"rules":[
"SecRuleEngine On",