Use setfenv in UI scripts
jakubg1 opened this issue · 0 comments
jakubg1 commented
Instead of this (main.lua):
-- Remove all potentially malicious OS functions, to prevent any external scripts
-- from causing damage by, for example, loading a game with a os.execute("format c:") line
-- in its UI script.
os = {
time = os.time,
date = os.date
}
it would be better to use a Lua's setfenv
method.