Fixes missing HTML encodes in comms console code (#89426)

## About The Pull Request

Prevents users from passing bad data.

## Changelog
🆑
fix: Fixed missing HTML encodes in comms console code
/🆑
This commit is contained in:
SmArtKar
2025-02-09 22:57:08 +00:00
committed by GitHub
parent 97827e597b
commit 4fe2ce9f2f
2 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -115,7 +115,7 @@
var/message = "<b color='orange'>CROSS-SECTOR MESSAGE (INCOMING):</b> [input["sender_ckey"]] (from [input["source"]]) is about to send \
the following message (will autoapprove in [soft_filter_passed ? "[extended_time_display]" : "[normal_time_display]"]): \
<b><a href='byond://?src=[REF(src)];reject_cross_comms_message=[timer_id]'>REJECT</a></b><br><br>\
[html_encode(input["message"])]"
[input["message"]]"
if(soft_filter_passed)
message += "<br><br><b>NOTE: This message passed the soft filter on the origin server! The time was automatically expanded to [extended_time_display].</b>"
@@ -321,7 +321,7 @@
if (!COOLDOWN_FINISHED(src, important_action_cooldown))
return
var/message = trim(params["message"], MAX_MESSAGE_LEN)
var/message = trim(html_encode(params["message"]), MAX_MESSAGE_LEN)
if (!message)
return
@@ -335,13 +335,16 @@
if(soft_filter_result)
if(tgui_alert(user,"Your message contains \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\". \"[soft_filter_result[CHAT_FILTER_INDEX_REASON]]\", Are you sure you want to use it?", "Soft Blocked Word", list("Yes", "No")) != "Yes")
return
message_admins("[ADMIN_LOOKUPFLW(user)] has passed the soft filter for \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\". They may be using a disallowed term for a cross-station message. Increasing delay time to reject.\n\n Message: \"[html_encode(message)]\"")
message_admins("[ADMIN_LOOKUPFLW(user)] has passed the soft filter for \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\". They may be using a disallowed term for a cross-station message. Increasing delay time to reject.\n\n Message: \"[message]\"")
log_admin_private("[key_name(user)] has passed the soft filter for \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\". They may be using a disallowed term for a cross-station message. Increasing delay time to reject.\n\n Message: \"[message]\"")
GLOB.communications_controller.soft_filtering = TRUE
playsound(src, 'sound/machines/terminal/terminal_prompt_confirm.ogg', 50, FALSE)
var/destination = params["destination"]
if (!(destination in CONFIG_GET(keyed_list/cross_server)) && destination != "all")
message_admins("[ADMIN_LOOKUPFLW(user)] has passed an invalid destination into comms console cross-sector message. Message: \"[message]\"")
return
user.log_message("is about to send the following message to [destination]: [message]", LOG_GAME)
to_chat(
@@ -350,7 +353,7 @@
"<b color='orange'>CROSS-SECTOR MESSAGE (OUTGOING):</b> [ADMIN_LOOKUPFLW(user)] is about to send \
the following message to <b>[destination]</b> (will autoapprove in [GLOB.communications_controller.soft_filtering ? DisplayTimeText(EXTENDED_CROSS_SECTOR_CANCEL_TIME) : DisplayTimeText(CROSS_SECTOR_CANCEL_TIME)]): \
<b><a href='byond://?src=[REF(src)];reject_cross_comms_message=1'>REJECT</a></b><br> \
[html_encode(message)]" \
[message]" \
)
)