mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-16 17:41:52 +03:00
Refactoring: Makes transformations to work with new execute signature
This commit is contained in:
@@ -439,7 +439,11 @@ std::string Lua::applyTransformations(lua_State *L, Transaction *t,
|
||||
"t:" + std::string(name));
|
||||
// FIXME: transformation is not yet returning null.
|
||||
if (tfn) {
|
||||
newVar = tfn->execute(newVar, t);
|
||||
ModSecStackString in;
|
||||
ModSecStackString out;
|
||||
in.assign(newVar.c_str(), newVar.size());
|
||||
tfn->execute(t, in, out);
|
||||
newVar.assign(out.c_str(), out.size());
|
||||
} else {
|
||||
ms_dbg_a(t, 1,
|
||||
"SecRuleScript: Invalid transformation function: " \
|
||||
@@ -461,7 +465,11 @@ std::string Lua::applyTransformations(lua_State *L, Transaction *t,
|
||||
|
||||
// FIXME: transformation is not yet returning null.
|
||||
if (tfn) {
|
||||
newVar = tfn->execute(newVar, t);
|
||||
ModSecStackString in;
|
||||
ModSecStackString out;
|
||||
in.assign(newVar.c_str(), newVar.size());
|
||||
tfn->execute(t, in, out);
|
||||
newVar.assign(out.c_str(), out.size());
|
||||
delete tfn;
|
||||
} else {
|
||||
ms_dbg_a(t, 1, "SecRuleScript: Invalid transformation function: " \
|
||||
|
||||
Reference in New Issue
Block a user