Add the / character to the ALLOWED_CHARS variable to fix bug with front slashes being stripped. Previously was turning /var/lib/freeswitch into varlibfreeswitch (#6773)

Co-authored-by: Jacob Buscher <jacob@bfitec.com>
This commit is contained in:
jacobbuscher-bt 2023-07-12 22:15:37 -06:00 committed by GitHub
parent 90259527cc
commit 28695de14c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -4,7 +4,7 @@
dir = dir:gsub([[\]], "/");
--retrieve allowed characters and then use it to sanitize the dir variable
local allowed_chars = os.getenv("ALLOWED_CHARS") or "^%a%d%-%._~"
local allowed_chars = os.getenv("ALLOWED_CHARS") or "^%a%d%-%._~/"
dir = dir:gsub("[^" .. allowed_chars .. "]", "")
if (package.config:sub(1,1) == "/") then