mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 11:44:32 +03:00
Refactoring: Place m_variables inside Collections
This commit is contained in:
@@ -61,7 +61,8 @@ bool Capture::evaluate(Rule *rule, Assay *assay) {
|
||||
|
||||
int i = 0;
|
||||
while (match->empty() == false) {
|
||||
assay->setCollection("TX", std::to_string(i), match->back());
|
||||
assay->m_collections.storeOrUpdateFirst("TX",
|
||||
std::to_string(i), match->back());
|
||||
match->pop_back();
|
||||
i++;
|
||||
}
|
||||
|
@@ -121,7 +121,7 @@ bool SetVar::evaluate(Rule *rule, Assay *assay) {
|
||||
|
||||
try {
|
||||
std::string *resolvedValue =
|
||||
assay->m_variables.resolveFirst(collectionName,
|
||||
assay->m_collections.resolveFirst(collectionName,
|
||||
variableNameExpanded);
|
||||
if (resolvedValue == NULL) {
|
||||
value = 0;
|
||||
@@ -146,7 +146,8 @@ bool SetVar::evaluate(Rule *rule, Assay *assay) {
|
||||
assay->debug(8, "Saving variable: " + collectionName + ":" + \
|
||||
variableNameExpanded + " with value: " + targetValue);
|
||||
#endif
|
||||
assay->setCollection(collectionName, variableNameExpanded, targetValue);
|
||||
assay->m_collections.storeOrUpdateFirst(collectionName,
|
||||
variableNameExpanded, targetValue);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user