From 6577b3c8d9efc26c0ae4e3dc4a32ed9cefa9a3d3 Mon Sep 17 00:00:00 2001 From: Meow <30401521+me0wg4ming@users.noreply.github.com> Date: Tue, 3 Mar 2026 23:10:55 +0100 Subject: [PATCH] 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. --- modules/share.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/share.lua b/modules/share.lua index a49841bc..b435f557 100644 --- a/modules/share.lua +++ b/modules/share.lua @@ -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) \ No newline at end of file