mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 19:47:47 +03:00
Refactoring on the RULE variable
This commit is contained in:
@@ -47,13 +47,18 @@ void RunTimeString::appendVar(
|
||||
|
||||
|
||||
std::string RunTimeString::evaluate(Transaction *t) {
|
||||
return evaluate(t, NULL);
|
||||
}
|
||||
|
||||
|
||||
std::string RunTimeString::evaluate(Transaction *t, Rule *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, NULL, &l);
|
||||
z->m_var->evaluate(t, r, &l);
|
||||
if (l.size() > 0) {
|
||||
s.append(l[0]->m_value);
|
||||
}
|
||||
@@ -65,5 +70,4 @@ std::string RunTimeString::evaluate(Transaction *t) {
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
} // namespace modsecurity
|
||||
|
Reference in New Issue
Block a user