mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-28 17:01:14 +00:00
Merge pull request #1853 from seltonmt012/fix/discord-presence-placeholders
fix(es_extended/client/modules/adjustments): escape placeholder values before substitution
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user