Skip to content

Commit e0b803d

Browse files
author
mergetest
committed
SafeSetFont: skip the text re-render for secret text entirely
Align with the 12.1 branch's independently-developed fix for the same taint bug: gate on issecretvalue before any boolean use of the text instead of doing the SetText round trip on secrets. Secret-text fontstrings rewrite on every update, so the font change still lands on the next natural SetText. Keeps the two branches' SafeSetFont identical.
1 parent afaad42 commit e0b803d

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

Config.lua

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -767,15 +767,18 @@ function DF:SafeSetFont(fontString, fontNameOrPath, fontSize, outline)
767767
-- This is needed because switching between font families with different outline flags
768768
-- may not immediately update the rendered text without a text refresh
769769
-- Note: the text may be a SECRET string (native cooldown countdown
770-
-- text, health text, ...). Truthiness on a secret is allowed, but a
771-
-- value comparison (~= "") is BLOCKED — and even inside pcall each
772-
-- blocked compare logs a DandersFrames taint incident (hundreds per
773-
-- minute in PvP instances; bugs #987/#988). GetText() returns nil,
774-
-- never "", for empty text, so truthiness is also the complete
775-
-- check. SetText accepts secret strings, so the round trip is safe.
770+
-- text, health text, unit names in combat). COMPARING a secret
771+
-- (text ~= "") is BLOCKED, and each blocked compare logs a
772+
-- DandersFrames taint incident even inside pcall — bugs #987/#988
773+
-- (hundreds/minute in PvP instances). Skip the re-render for secret
774+
-- text: issecretvalue runs BEFORE any boolean use of the value, and
775+
-- secret-text fontstrings rewrite on every update anyway, so the
776+
-- font change lands on the next natural SetText. The old `~= ""`
777+
-- guard is dropped as redundant — GetText() returns nil, never "",
778+
-- for empty text. (Kept identical to the 12.1 branch's version.)
776779
pcall(function()
777780
local text = fontString:GetText()
778-
if text then
781+
if not (issecretvalue and issecretvalue(text)) and text then
779782
fontString:SetText("")
780783
fontString:SetText(text)
781784
end

0 commit comments

Comments
 (0)