Create shell_esc.lua

This commit is contained in:
FusionPBX 2023-01-04 19:48:36 -07:00 committed by GitHub
parent 1e49e686c9
commit 0dbbdd000e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

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