Skip to content
Snippets Groups Projects
Commit 1c0f0b86 authored by George Kiagiadakis's avatar George Kiagiadakis
Browse files

wplua: pass SANDBOX_CONFIG as a script argument

avoids keeping it forever as a global
parent 460ff659
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@
--
-- SPDX-License-Identifier: MIT
local SANDBOX_CONFIG = ...
local SANDBOX_ENV = {}
local function populate_env(id)
......
......@@ -127,9 +127,8 @@ wplua_enable_sandbox (lua_State * L, WpLuaSandboxFlags flags)
lua_pushliteral (L, "isolate_env");
lua_pushboolean (L, (flags & WP_LUA_SANDBOX_ISOLATE_ENV));
lua_settable (L, -3);
lua_setglobal (L, "SANDBOX_CONFIG");
if (!wplua_load_uri (L, URI_SANDBOX, 0, 0, &error)) {
if (!wplua_load_uri (L, URI_SANDBOX, 1, 0, &error)) {
wp_critical ("Failed to load sandbox: %s", error->message);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment