diff --git a/modules/module-lua-scripting/wplua/sandbox.lua b/modules/module-lua-scripting/wplua/sandbox.lua index 9ffe8d40..9c2c17dd 100644 --- a/modules/module-lua-scripting/wplua/sandbox.lua +++ b/modules/module-lua-scripting/wplua/sandbox.lua @@ -43,6 +43,9 @@ function create_sandbox_env() if type(v) == "table" then SANDBOX_ENV[k] = setmetatable({}, { __index = v, + __call = function(t, ...) + return t["__new"](...) + end, __newindex = function(_, attr_name, _) error('Can not modify ' .. k .. '.' .. attr_name .. '. Protected by the sandbox.') end