mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-10-04 05:22:57 +03:00
Adds support for update target by message
This commit is contained in:
@@ -39,6 +39,17 @@ bool RulesExceptions::loadRemoveRuleByMsg(const std::string &msg,
|
||||
}
|
||||
|
||||
|
||||
bool RulesExceptions::loadUpdateTargetByMsg(const std::string &msg,
|
||||
std::unique_ptr<std::vector<std::unique_ptr<Variables::Variable> > > var,
|
||||
std::string *error) {
|
||||
for (auto &i : *var) {
|
||||
m_variable_update_target_by_msg.emplace(std::pair<std::shared_ptr<std::string>, std::unique_ptr<Variables::Variable>>(std::make_shared<std::string>(msg), std::move(i)));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool RulesExceptions::loadUpdateTargetByTag(const std::string &tag,
|
||||
std::unique_ptr<std::vector<std::unique_ptr<Variables::Variable> > > var,
|
||||
std::string *error) {
|
||||
@@ -167,6 +178,10 @@ bool RulesExceptions::merge(RulesExceptions& from) {
|
||||
m_variable_update_target_by_tag.emplace(std::pair<std::shared_ptr<std::string>, std::unique_ptr<Variables::Variable>>(p.first, std::move(p.second)));
|
||||
}
|
||||
|
||||
for (auto &p : from.m_variable_update_target_by_msg) {
|
||||
m_variable_update_target_by_msg.emplace(std::pair<std::shared_ptr<std::string>, std::unique_ptr<Variables::Variable>>(p.first, std::move(p.second)));
|
||||
}
|
||||
|
||||
for (auto &p : from.m_variable_update_target_by_id) {
|
||||
m_variable_update_target_by_id.emplace(std::pair<double, std::unique_ptr<Variables::Variable>>(p.first, std::move(p.second)));
|
||||
}
|
||||
|
Reference in New Issue
Block a user