Add tostring, tonumber, string to luacontroller, prohibit 'function'

This commit is contained in:
Jeija 2013-01-22 21:15:49 +01:00
parent 2b30360da2
commit 59cd72191b

@ -139,7 +139,7 @@ end
local code_prohibited = function(code)
-- Clean code
local prohibited = {"while", "for", "repeat", "until"}
local prohibited = {"while", "for", "repeat", "until", "function"}
for _, p in ipairs(prohibited) do
if string.find(code, p) then
return "Prohibited command: "..p
@ -188,6 +188,9 @@ local create_environment = function(pos, mem, event)
interrupt = getinterrupt(pos),
digiline_send = getdigiline_send(pos),
mem = mem,
tostring = tostring,
tonumber = tonumber,
string = string,
event = event}
end