mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-10-01 03:57:47 +03:00
fix: function m.setvar not work in lua script
This commit is contained in:
@@ -371,26 +371,32 @@ int Lua::setvar(lua_State *L) {
|
|||||||
|
|
||||||
if (collection == "TX") {
|
if (collection == "TX") {
|
||||||
t->m_collections.m_tx_collection->storeOrUpdateFirst(
|
t->m_collections.m_tx_collection->storeOrUpdateFirst(
|
||||||
"TX:" + variableName, "", var_value);
|
variableName,
|
||||||
|
var_value);
|
||||||
}
|
}
|
||||||
else if (collection == "IP") {
|
else if (collection == "IP") {
|
||||||
t->m_collections.m_ip_collection->storeOrUpdateFirst(
|
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);
|
var_value);
|
||||||
}
|
}
|
||||||
else if (collection == "GLOBAL") {
|
else if (collection == "GLOBAL") {
|
||||||
t->m_collections.m_global_collection->storeOrUpdateFirst(
|
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);
|
var_value);
|
||||||
}
|
}
|
||||||
else if (collection == "RESOURCE") {
|
else if (collection == "RESOURCE") {
|
||||||
t->m_collections.m_resource_collection->storeOrUpdateFirst(
|
t->m_collections.m_resource_collection->storeOrUpdateFirst(
|
||||||
"RESOURCE:" + variableName,
|
variableName,
|
||||||
t->m_collections.m_resource_collection_key, var_value);
|
t->m_collections.m_resource_collection_key,
|
||||||
|
t->m_rules->m_secWebAppId.m_value,
|
||||||
|
var_value);
|
||||||
}
|
}
|
||||||
else if (collection == "SESSION") {
|
else if (collection == "SESSION") {
|
||||||
t->m_collections.m_session_collection->storeOrUpdateFirst(
|
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);
|
var_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user