mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-16 17:41:52 +03:00
Actions refactoring: now there is a clear definiation on the action name
This commit is contained in:
@@ -27,14 +27,16 @@
|
||||
namespace modsecurity {
|
||||
namespace actions {
|
||||
|
||||
Accuracy::Accuracy(std::string action)
|
||||
: Action(action, ConfigurationKind),
|
||||
m_accuracy_str(action) {
|
||||
if (m_accuracy_str.at(0) == '\'') {
|
||||
m_accuracy_str.erase(0, 1);
|
||||
m_accuracy_str.pop_back();
|
||||
|
||||
bool Accuracy::init(std::string *error) {
|
||||
try {
|
||||
m_accuracy = std::stoi(m_parser_payload);
|
||||
} catch (...) {
|
||||
error->assign("Accuracy: The input \"" + m_parser_payload + "\" is " \
|
||||
"not a number.");
|
||||
return false;
|
||||
}
|
||||
m_accuracy = std::stoi(m_accuracy_str);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,5 +45,6 @@ bool Accuracy::evaluate(Rule *rule, Transaction *transaction) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
} // namespace actions
|
||||
} // namespace modsecurity
|
||||
|
||||
Reference in New Issue
Block a user