From b35d5fc1424af67be35a82af1f9e6bbf0661be41 Mon Sep 17 00:00:00 2001 From: Rob Nelson Date: Mon, 12 Oct 2015 20:42:32 -0700 Subject: [PATCH] Fix double-encoding deadchat --- code/modules/mob/dead/observer/say.dm | 2 +- code/modules/mob/living/say.dm | 2 +- code/modules/mob/living/simple_animal/borer.dm | 12 +++++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/code/modules/mob/dead/observer/say.dm b/code/modules/mob/dead/observer/say.dm index 5ef1764ff32..1ee5fb161ce 100644 --- a/code/modules/mob/dead/observer/say.dm +++ b/code/modules/mob/dead/observer/say.dm @@ -1,5 +1,5 @@ /mob/dead/observer/say(var/message) - message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)) + message = trim(copytext(message, 1, MAX_MESSAGE_LEN)) if (!message) return diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 9e298757b51..6fb263fa313 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -113,7 +113,7 @@ var/list/department_radio_keys = list( /mob/living/say(var/message, bubble_type) say_testing(src, "/mob/living/say(\"[message]\", [bubble_type]") if(timestopped) return //under the effects of time magick - message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)) + message = trim(copytext(message, 1, MAX_MESSAGE_LEN)) message = capitalize(message) say_testing(src, "Say start, message=[message]") diff --git a/code/modules/mob/living/simple_animal/borer.dm b/code/modules/mob/living/simple_animal/borer.dm index 066da3f2954..c4b2c18ccb2 100644 --- a/code/modules/mob/living/simple_animal/borer.dm +++ b/code/modules/mob/living/simple_animal/borer.dm @@ -155,7 +155,7 @@ var/global/borer_unlock_types = typesof(/datum/unlockable/borer) - /datum/unlock /mob/living/simple_animal/borer/say(var/message) - message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)) + message = trim(copytext(message, 1, MAX_MESSAGE_LEN)) message = capitalize(message) if(!message) @@ -184,8 +184,10 @@ var/global/borer_unlock_types = typesof(/datum/unlockable/borer) - /datum/unlock src << "You have no host to speak to." return //No host, no audible speech. - src << "You drop words into [host]'s mind: \"[message]\"" - host << "\"[message]\"" + var/encoded_message = html_encode(message) + + src << "You drop words into [host]'s mind: \"[encoded_message]\"" + host << "\"[encoded_message]\"" var/turf/T = get_turf(src) log_say("[truename] [key_name(src)] (@[T.x],[T.y],[T.z]) -> [host]([key_name(host)]) Borer->Host Speech: [message]") @@ -196,13 +198,13 @@ var/global/borer_unlock_types = typesof(/datum/unlockable/borer) - /datum/unlock var/controls = "Follow" if(M.client.holder) controls+= " | ?" - var/rendered="Thought-speech, [truename] ([controls]) -> [host]: [message]" + var/rendered="Thought-speech, [truename] ([controls]) -> [host]: [encoded_message]" M.show_message(rendered, 2) //Takes into account blindness and such. /* for(var/mob/M in mob_list) if(M.mind && (istype(M, /mob/dead/observer))) - M << "Thought-speech, [truename] -> [host]: [copytext(message, 2)]" + M << "Thought-speech, [truename] -> [host]: [copytext(html_encode(message), 2)]" */ /mob/living/simple_animal/borer/Stat()