mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-15 23:55:03 +03:00
Fix macro expansion string replacement
It was removing more characters from the string than the actual %{variable}%
This commit is contained in:
parent
45d81e1c04
commit
3de845fac1
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user