We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b7c8759 + e7dbd6e commit 3941c7aCopy full SHA for 3941c7a
lib/dtutils/string.lua
@@ -306,8 +306,16 @@ end
306
local function _should_be_sanitized(str)
307
local old_log_level = log.log_level()
308
local result = false
309
+ local UNSAFE_POSIX_FILENAME_CHARS <const> = "[^%w/._%-]+"
310
+ local UNSAFE_WIN_FILENAME_CHARS <const> = "[^%w\\._%-:]+"
311
+
312
+ local pattern = UNSAFE_POSIX_FILENAME_CHARS
313
+ if dt.configuration.running_os == "windows" then
314
+ pattern = UNSAFE_WIN_FILENAME_CHARS
315
+ end
316
317
log.log_level(dtutils_string.log_level)
- if string.match(str, "[^%g]") then
318
+ if string.match(str, pattern) then
319
result = true
320
end
321
log.log_level(old_log_level)
0 commit comments