diff --git a/app/switch/resources/scripts/resources/functions/copy.lua b/app/switch/resources/scripts/resources/functions/copy.lua index daf56c3f5..0d47bcd7e 100644 --- a/app/switch/resources/scripts/resources/functions/copy.lua +++ b/app/switch/resources/scripts/resources/functions/copy.lua @@ -1,8 +1,9 @@ --add the copy function function copy(src,dst) --retrieve allowed characters and then use it to sanitize the dir variable - local allowed_chars = os.getenv("ALLOWED_CHARS") or "^%a%d%-%._~/" - dir = dir:gsub("[^" .. allowed_chars .. "]", "") + local allowed_chars = os.getenv("ALLOWED_CHARS") or "^%a%d%-%._~/"; + src = src:gsub("[^" .. allowed_chars .. "]", ""); + dst = dst:gsub("[^" .. allowed_chars .. "]", ""); if (package.config:sub(1,1) == "/") then --unix @@ -15,4 +16,4 @@ end os.execute(cmd); return cmd; - end \ No newline at end of file + end