mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-19 11:00:50 +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:
+3
-1
@@ -15,7 +15,9 @@ pfUI:RegisterModule("share", "vanilla:tbc", function ()
|
|||||||
end
|
end
|
||||||
elseif type(v) == "string" then
|
elseif type(v) == "string" then
|
||||||
match = true
|
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
|
elseif type(v) == "number" then
|
||||||
match = true
|
match = true
|
||||||
str = str .. spacing .. " [\""..k.."\"] = ".. string.gsub(v, "\\", "\\\\") ..",\n"
|
str = str .. spacing .. " [\""..k.."\"] = ".. string.gsub(v, "\\", "\\\\") ..",\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user