From e5c4e8cc1fdc17f016a5a1956041ddc5cd0d407d Mon Sep 17 00:00:00 2001 From: orwell96 Date: Fri, 22 Feb 2019 12:52:33 +0100 Subject: Lift restrictions for date() function in atlatc --- advtrains_luaautomation/environment.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/advtrains_luaautomation/environment.lua b/advtrains_luaautomation/environment.lua index 5bf7527..e0bfa69 100644 --- a/advtrains_luaautomation/environment.lua +++ b/advtrains_luaautomation/environment.lua @@ -58,8 +58,14 @@ local function safe_print(t, ...) minetest.chat_send_all(str) end -local function safe_date() - return(os.date("*t",os.time())) +local function safe_date(f, t) + if not f then + -- fall back to old behavior + return(os.date("*t",os.time())) + else + --pass parameters + return os.date(f,t) + end end -- string.rep(str, n) with a high value for n can be used to DoS -- cgit v1.2.3