Fix Luacontroller’s print() (#422)

Because of working inside the sandbox, it was unable to print tables.
This commit is contained in:
Vitaliy 2018-07-23 15:53:32 +03:00 committed by GitHub
parent 334400a541
commit d4e05f33af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -198,7 +198,11 @@ end
-------------------------
local function safe_print(param)
local string_meta = getmetatable("")
local sandbox = string_meta.__index
string_meta.__index = string -- Leave string sandbox temporarily
print(dump(param))
string_meta.__index = sandbox -- Restore string sandbox
end
local function safe_date()