mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 19:47:47 +03:00
Refactoring: Splits Rule into Rule and RuleWithActions
This commit is contained in:
@@ -51,14 +51,16 @@ std::string RunTimeString::evaluate(Transaction *t) {
|
||||
}
|
||||
|
||||
|
||||
std::string RunTimeString::evaluate(Transaction *t, Rule *r) {
|
||||
std::string RunTimeString::evaluate(Transaction *t, RuleBase *r) {
|
||||
std::string s;
|
||||
for (auto &z : m_elements) {
|
||||
if (z->m_string.size() > 0) {
|
||||
s.append(z->m_string);
|
||||
} else if (z->m_var != NULL && t != NULL) {
|
||||
std::vector<const VariableValue *> l;
|
||||
z->m_var->evaluate(t, r, &l);
|
||||
// FIXME: This cast should be removed.
|
||||
Rule *rr = dynamic_cast<Rule *>(r);
|
||||
z->m_var->evaluate(t, rr, &l);
|
||||
if (l.size() > 0) {
|
||||
s.append(l[0]->getValue());
|
||||
}
|
||||
|
Reference in New Issue
Block a user