mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-03-31 13:39:55 +00:00
Add sanitize for the lua copy function
This commit is contained in:
@@ -1,5 +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 .. "]", "")
|
||||
|
||||
if (package.config:sub(1,1) == "/") then
|
||||
--unix
|
||||
cmd = [[cp "]] .. src .. [[" "]] .. dst .. [["]];
|
||||
|
||||
Reference in New Issue
Block a user