fusionpbx/app/switch/resources/scripts/resources/functions/shell_esc.lua

7 lines
144 B
Lua

--escape shell arguments to prevent command injection
local function shell_esc(x)
return (x:gsub('\\', '\\\\')
:gsub('\'', '\\\''))
end