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.
1 parent 4f8df88 commit 300bb9dCopy full SHA for 300bb9d
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 SAFE_POSIX_FILENAME_CHARS <const> = "[^%w/._%-]+"
310
+ local SAFE_WIN_FILENAME_CHARS <const> = "[^%w\\._%-:]+"
311
+
312
+ local pattern = SAFE_POSIX_STRING_CHARS
313
+ if dt.configuration.running_os == "windows" then
314
+ pattern = SAFE_WIN_STRING_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