From 3a4d2917487809f565d89b1aba84b660963709cb Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Mon, 2 Nov 2026 16:23:36 -0600 Subject: [PATCH] fix(link): split links with string.split captured at load LinkUtil.SplitLinkData and SplitLinkOptions looked up string.split on every call. BigWigs (pepopo978 fork) defines a table-returning string:split in Plugins/SpellRequests.lua, which replaces the global, so with it loaded every custom link type resolved to a table, no handler matched, and SetItemRef rejected the link as unknown. string.split is registered in C by the DLL before any addon loads, so a file-local captured when LinkUtil.lua loads always holds the real one. Fixes brues-code/pfUI#73 --- src/embed/AddOns/!!!ClassicAPI/Util/LinkUtil.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/embed/AddOns/!!!ClassicAPI/Util/LinkUtil.lua b/src/embed/AddOns/!!!ClassicAPI/Util/LinkUtil.lua index 692f1703..ae3bb5e5 100644 --- a/src/embed/AddOns/!!!ClassicAPI/Util/LinkUtil.lua +++ b/src/embed/AddOns/!!!ClassicAPI/Util/LinkUtil.lua @@ -1,3 +1,5 @@ +local strsplit = string.split; + LinkTypes = { AADCOpenConfig = "aadcopenconfig", Action = "action", @@ -75,7 +77,7 @@ function LinkUtil.FormatLink(linkType, linkDisplayText, ...) end function LinkUtil.SplitLinkData(linkData) - local linkType, linkOptions = string.split(":", linkData, 2); + local linkType, linkOptions = strsplit(":", linkData, 2); linkOptions = linkOptions or ""; -- Could be nil if there's no ":" in linkData. return linkType, linkOptions; end @@ -85,7 +87,7 @@ function LinkUtil.SplitLink(link) -- returns linkText and displayText end function LinkUtil.SplitLinkOptions(linkOptions) - return string.split(":", linkOptions); + return strsplit(":", linkOptions); end -- Extract the first link from the text given, ignoring leading and trailing characters.