Update hangup_rx.lua

Prevent an error if the value of x is nil.
This commit is contained in:
FusionPBX 2024-10-17 02:29:23 -06:00 committed by GitHub
parent 5459bca44b
commit 581c6177cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -63,6 +63,7 @@
--escape shell arguments to prevent command injection --escape shell arguments to prevent command injection
local function shell_esc(x) local function shell_esc(x)
if (x == nil) then return '' end
return (x:gsub('\\', '\\\\') return (x:gsub('\\', '\\\\')
:gsub('\'', '\\\'')) :gsub('\'', '\\\''))
end end