mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-16 09:31:53 +03:00
Fix macro expansion string replacement
It was removing more characters from the string than the actual %{variable}%
This commit is contained in:
@@ -42,7 +42,7 @@ std::string MacroExpansion::expand(const std::string& input, Assay *assay) {
|
|||||||
variableValue = assay->resolve_variable_first(col, var);
|
variableValue = assay->resolve_variable_first(col, var);
|
||||||
}
|
}
|
||||||
|
|
||||||
res.erase(start, end + 2);
|
res.erase(start, end - start + 2);
|
||||||
if (variableValue != NULL) {
|
if (variableValue != NULL) {
|
||||||
res.insert(start, *variableValue);
|
res.insert(start, *variableValue);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user