mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-27 01:46:03 +00:00
fix: escape double quotes in share module serialize
- The serialize() function didn't escape " in string values, causing exports to be invalid Lua whenever a value contained double quotes (e.g. clickcast macros like CastSpellByName("Nature's Swiftness")). This made the Import button stay red with no error message.
This commit is contained in:
+4
-2
@@ -15,7 +15,9 @@ pfUI:RegisterModule("share", "vanilla:tbc", function ()
|
||||
end
|
||||
elseif type(v) == "string" then
|
||||
match = true
|
||||
str = str .. spacing .. " [\""..k.."\"] = \"".. string.gsub(v, "\\", "\\\\") .."\",\n"
|
||||
local escaped = string.gsub(v, "\\", "\\\\")
|
||||
escaped = string.gsub(escaped, "\"", "\\\"")
|
||||
str = str .. spacing .. " [\""..k.."\"] = \"".. escaped .."\",\n"
|
||||
elseif type(v) == "number" then
|
||||
match = true
|
||||
str = str .. spacing .. " [\""..k.."\"] = ".. string.gsub(v, "\\", "\\\\") ..",\n"
|
||||
@@ -446,4 +448,4 @@ pfUI:RegisterModule("share", "vanilla:tbc", function ()
|
||||
f:Show()
|
||||
end
|
||||
end
|
||||
end)
|
||||
end)
|
||||
Reference in New Issue
Block a user