fix(es_extended/client/modules/adjustments): escape placeholder values

Placeholder results go straight into gsub as the replacement string, so a %
in a player name either throws and kills the presence thread or silently
mangles the output. The "Unknown" fallback above it was unreachable because
the error() on the previous line always propagates.
This commit is contained in:
Selt
2026-07-28 01:46:58 +02:00
parent 5354e278de
commit e60674cb56
@@ -175,11 +175,11 @@ function Adjustments:ReplacePlaceholders(text)
local success, result = pcall(cb)
if not success then
error(("Failed to execute placeholder: ^5%s^7\n%s"):format(placeholder, result))
print(("[^1ERROR^7] Failed to execute placeholder: ^5%s^7\n%s"):format(placeholder, result))
result = "Unknown"
end
text = text:gsub(("{%s}"):format(placeholder), tostring(result))
text = text:gsub(("{%s}"):format(placeholder), (tostring(result):gsub("%%", "%%%%")))
end
return text
end