summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeija <jeija@mesecons.net>2013-01-22 21:15:49 +0100
committerJeija <jeija@mesecons.net>2013-01-22 21:15:49 +0100
commit59cd72191b89e15dfd901dde487c6eb13252c3ba (patch)
treea13705d03964e6d72317fbdfdf7713e2663b9c23
parent2b30360da23cedecdd45f2a8060d87a9e3038ac8 (diff)
downloadmesecons-59cd72191b89e15dfd901dde487c6eb13252c3ba.tar
mesecons-59cd72191b89e15dfd901dde487c6eb13252c3ba.tar.gz
mesecons-59cd72191b89e15dfd901dde487c6eb13252c3ba.tar.bz2
mesecons-59cd72191b89e15dfd901dde487c6eb13252c3ba.tar.xz
mesecons-59cd72191b89e15dfd901dde487c6eb13252c3ba.zip
Add tostring, tonumber, string to luacontroller, prohibit 'function'
-rw-r--r--mesecons_luacontroller/init.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/mesecons_luacontroller/init.lua b/mesecons_luacontroller/init.lua
index 76e08bd..344e0d3 100644
--- a/mesecons_luacontroller/init.lua
+++ b/mesecons_luacontroller/init.lua
@@ -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