From e7dbd6e369cb0e402f9f00894edfbbf1c38adcec Mon Sep 17 00:00:00 2001 From: Bill Ferguson Date: Mon, 28 Oct 2024 20:41:02 -0400 Subject: [PATCH] lib/dtutils/string - fixed constant names to correctly define the patterns as the unsafe filename characters. --- lib/dtutils/string.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/dtutils/string.lua b/lib/dtutils/string.lua index c142b1a..c8a1ce9 100644 --- a/lib/dtutils/string.lua +++ b/lib/dtutils/string.lua @@ -306,12 +306,12 @@ end local function _should_be_sanitized(str) local old_log_level = log.log_level() local result = false - local SAFE_POSIX_FILENAME_CHARS = "[^%w/._%-]+" - local SAFE_WIN_FILENAME_CHARS = "[^%w\\._%-:]+" + local UNSAFE_POSIX_FILENAME_CHARS = "[^%w/._%-]+" + local UNSAFE_WIN_FILENAME_CHARS = "[^%w\\._%-:]+" - local pattern = SAFE_POSIX_FILENAME_CHARS + local pattern = UNSAFE_POSIX_FILENAME_CHARS if dt.configuration.running_os == "windows" then - pattern = SAFE_WIN_FILENAME_CHARS + pattern = UNSAFE_WIN_FILENAME_CHARS end log.log_level(dtutils_string.log_level)