mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-16 07:56:12 +03:00
Removed unnecessary dynamic_casts
This commit is contained in:
parent
a23e88f79f
commit
18378c10f8
@ -213,7 +213,7 @@ void RuleWithActions::executeActionsIndependentOfChainedRuleResult(Transaction *
|
|||||||
if (m_ruleId != b.first) {
|
if (m_ruleId != b.first) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
actions::Action *a = dynamic_cast<actions::Action*>(b.second.get());
|
actions::Action *a = b.second.get();
|
||||||
if (a->isDisruptive() == true && *a->m_name.get() == "block") {
|
if (a->isDisruptive() == true && *a->m_name.get() == "block") {
|
||||||
ms_dbg_a(trans, 9, "Rule contains a `block' action");
|
ms_dbg_a(trans, 9, "Rule contains a `block' action");
|
||||||
*containsBlock = true;
|
*containsBlock = true;
|
||||||
@ -266,7 +266,7 @@ void RuleWithActions::executeActionsAfterFullMatch(Transaction *trans,
|
|||||||
if (m_ruleId != b.first) {
|
if (m_ruleId != b.first) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
actions::Action *a = dynamic_cast<actions::Action*>(b.second.get());
|
actions::Action *a = b.second.get();
|
||||||
executeAction(trans, containsBlock, ruleMessage, a, false);
|
executeAction(trans, containsBlock, ruleMessage, a, false);
|
||||||
disruptiveAlreadyExecuted = true;
|
disruptiveAlreadyExecuted = true;
|
||||||
}
|
}
|
||||||
@ -394,8 +394,7 @@ void RuleWithActions::executeTransformations(
|
|||||||
|
|
||||||
for (Transformation *a : m_transformations) {
|
for (Transformation *a : m_transformations) {
|
||||||
if (none == 0) {
|
if (none == 0) {
|
||||||
Transformation *t = dynamic_cast<Transformation *>(a);
|
executeTransformation(a, &value, trans, &ret, &path,
|
||||||
executeTransformation(t, &value, trans, &ret, &path,
|
|
||||||
&transformations);
|
&transformations);
|
||||||
}
|
}
|
||||||
if (a->m_isNone) {
|
if (a->m_isNone) {
|
||||||
@ -423,8 +422,7 @@ void RuleWithActions::executeTransformations(
|
|||||||
}
|
}
|
||||||
Transformation *a = dynamic_cast<Transformation*>(b.second.get());
|
Transformation *a = dynamic_cast<Transformation*>(b.second.get());
|
||||||
if (none == 0) {
|
if (none == 0) {
|
||||||
Transformation *t = dynamic_cast<Transformation *>(a);
|
executeTransformation(a, &value, trans, &ret, &path,
|
||||||
executeTransformation(t, &value, trans, &ret, &path,
|
|
||||||
&transformations);
|
&transformations);
|
||||||
}
|
}
|
||||||
if (a->m_isNone) {
|
if (a->m_isNone) {
|
||||||
@ -479,7 +477,7 @@ std::vector<actions::Action *> RuleWithActions::getActionsByName(const std::stri
|
|||||||
if (m_ruleId != b.first) {
|
if (m_ruleId != b.first) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
actions::Action *z = dynamic_cast<actions::Action*>(b.second.get());
|
actions::Action *z = b.second.get();
|
||||||
if (*z->m_name.get() == name) {
|
if (*z->m_name.get() == name) {
|
||||||
ret.push_back(z);
|
ret.push_back(z);
|
||||||
}
|
}
|
||||||
@ -489,7 +487,7 @@ std::vector<actions::Action *> RuleWithActions::getActionsByName(const std::stri
|
|||||||
if (m_ruleId != b.first) {
|
if (m_ruleId != b.first) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
actions::Action *z = dynamic_cast<actions::Action*>(b.second.get());
|
actions::Action *z = b.second.get();
|
||||||
if (*z->m_name.get() == name) {
|
if (*z->m_name.get() == name) {
|
||||||
ret.push_back(z);
|
ret.push_back(z);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user