Skip to content

Commit 5331a38

Browse files
committed
lib/dtutils/string - added % and + to sanitize_lua() to prevent
pattern matching problems
1 parent c9943a2 commit 5331a38

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/dtutils/string.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,11 @@ dtutils_string.libdoc.functions["sanitize_lua"] = {
331331
function dtutils_string.sanitize_lua(str)
332332
local old_log_level = log.log_level()
333333
log.log_level(dtutils_string.log_level)
334+
str = string.gsub(str, "%%", "%%%%")
334335
str = string.gsub(str, "%-", "%%-")
335336
str = string.gsub(str, "%(", "%%(")
336337
str = string.gsub(str, "%)", "%%)")
338+
str = string.gsub(str, "+", "%%+")
337339
log.log_level(old_log_level)
338340
return str
339341
end

0 commit comments

Comments
 (0)