From 9ca3144086a2030f0a0d1e1b4d2e57c47c6876ce Mon Sep 17 00:00:00 2001 From: Geeves <22774890+Geevies@users.noreply.github.com> Date: Thu, 4 Sep 2025 19:50:01 +0200 Subject: [PATCH] Fixes Exploitable Formatting (#21281) * Fixed exploitables not formatting correctly. Before: image After: image --- code/game/objects/items/devices/uplink.dm | 3 +-- html/changelogs/geeves-exploitable_formatting.yml | 6 ++++++ tgui/packages/tgui/interfaces/Uplink.tsx | 11 ++++++++--- 3 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 html/changelogs/geeves-exploitable_formatting.yml diff --git a/code/game/objects/items/devices/uplink.dm b/code/game/objects/items/devices/uplink.dm index 2386e4c238b..57388eced93 100644 --- a/code/game/objects/items/devices/uplink.dm +++ b/code/game/objects/items/devices/uplink.dm @@ -206,8 +206,7 @@ Then check if it's true, if true return. This will stop the normal menu appearin tgui_data["exploit"] = list() // Setting this to equal L.fields passes it's variables that are lists as reference instead of value. // We trade off being able to automatically add shit for more control over what gets passed to json // and if it's sanitized for html. - tgui_data["exploit"]["tgui_exploit_record"] = html_encode(L.exploit_record) // Change stuff into html - tgui_data["exploit"]["tgui_exploit_record"] = replacetext(tgui_data["exploit"]["tgui_exploit_record"], "\n", "
") // change line breaks into
+ tgui_data["exploit"]["tgui_exploit_record"] = html_decode(L.exploit_record) // this user input is already sanitized and encoded when saved to the DB, we can just decode it and slap it into a span tgui_data["exploit"]["name"] = html_encode(L.name) tgui_data["exploit"]["sex"] = html_encode(L.sex) tgui_data["exploit"]["age"] = html_encode(L.age) diff --git a/html/changelogs/geeves-exploitable_formatting.yml b/html/changelogs/geeves-exploitable_formatting.yml new file mode 100644 index 00000000000..5083de7a4c5 --- /dev/null +++ b/html/changelogs/geeves-exploitable_formatting.yml @@ -0,0 +1,6 @@ +author: Geeves + +delete-after: True + +changes: + - bugfix: "Fixed exploitables not formatting correctly." diff --git a/tgui/packages/tgui/interfaces/Uplink.tsx b/tgui/packages/tgui/interfaces/Uplink.tsx index 98683b8b6ee..f3ad062f1b7 100644 --- a/tgui/packages/tgui/interfaces/Uplink.tsx +++ b/tgui/packages/tgui/interfaces/Uplink.tsx @@ -334,9 +334,14 @@ const ExploitRecordSection = function (act: any, data: UplinkData) { - {exploit.tgui_exploit_record - ? exploit.tgui_exploit_record - : 'No additional information acquired.'} + + {exploit.tgui_exploit_record + ? exploit.tgui_exploit_record + : 'No additional information acquired.'} + ); } else {