mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
fix: function m.setvar not work in lua script
This commit is contained in:
parent
c2bc695265
commit
45cdb0ed90
@ -371,26 +371,32 @@ int Lua::setvar(lua_State *L) {
|
||||
|
||||
if (collection == "TX") {
|
||||
t->m_collections.m_tx_collection->storeOrUpdateFirst(
|
||||
"TX:" + variableName, "", var_value);
|
||||
variableName,
|
||||
var_value);
|
||||
}
|
||||
else if (collection == "IP") {
|
||||
t->m_collections.m_ip_collection->storeOrUpdateFirst(
|
||||
"IP:" + variableName, t->m_collections.m_ip_collection_key,
|
||||
variableName, t->m_collections.m_ip_collection_key,
|
||||
t->m_rules->m_secWebAppId.m_value,
|
||||
var_value);
|
||||
}
|
||||
else if (collection == "GLOBAL") {
|
||||
t->m_collections.m_global_collection->storeOrUpdateFirst(
|
||||
"GLOBAL:" + variableName, t->m_collections.m_global_collection_key,
|
||||
variableName, t->m_collections.m_global_collection_key,
|
||||
t->m_rules->m_secWebAppId.m_value,
|
||||
var_value);
|
||||
}
|
||||
else if (collection == "RESOURCE") {
|
||||
t->m_collections.m_resource_collection->storeOrUpdateFirst(
|
||||
"RESOURCE:" + variableName,
|
||||
t->m_collections.m_resource_collection_key, var_value);
|
||||
variableName,
|
||||
t->m_collections.m_resource_collection_key,
|
||||
t->m_rules->m_secWebAppId.m_value,
|
||||
var_value);
|
||||
}
|
||||
else if (collection == "SESSION") {
|
||||
t->m_collections.m_session_collection->storeOrUpdateFirst(
|
||||
"SESSION:" + variableName, t->m_collections.m_session_collection_key,
|
||||
variableName, t->m_collections.m_session_collection_key,
|
||||
t->m_rules->m_secWebAppId.m_value,
|
||||
var_value);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user