mirror of
https://github.com/mt-mods/home_workshop_modpack.git
synced 2024-11-15 23:20:22 +01:00
additional security
This commit is contained in:
parent
2060c59920
commit
3e4e65e01b
|
@ -1,7 +1,7 @@
|
|||
function cd(pos, input, data)
|
||||
local path = computers.devicepath .. "/" .. minetest.hash_node_position(pos) .. data.element.pwd
|
||||
|
||||
if input and input ~= "" and not input:find("/") then
|
||||
if input and input ~= "" and not input:find("/") and not input:find("\\") then
|
||||
if input == ".." then
|
||||
local uri = data.element.pwd:split("/")
|
||||
uri[#uri] = nil
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function mkdir(pos, input, data)
|
||||
local path = computers.devicepath .. "/" .. minetest.hash_node_position(pos) .. data.element.pwd
|
||||
|
||||
if input and input ~= "" and not input:find("/") then
|
||||
if input and input ~= "" and not input:find("/") and not input:find("\\") then
|
||||
minetest.mkdir(path .. "/" .. input)
|
||||
return "folder " .. input .. " created"
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue
Block a user