From 458db2011debcd96683d8717922a70304ded7ae0 Mon Sep 17 00:00:00 2001 From: Robustin Date: Wed, 19 Aug 2015 15:39:31 -0400 Subject: [PATCH] Fixes the apostrophe issue Maybe... Doubtfully... But I wanted to give it a try since I'm tired of my glorious pronouncements garbled in &39 If I actually fixed it then I should get a medal for best coding by someone who can't code. My logic was that WHISPER works just fine with apostrophes and ampersands but shuttle call reasons, announcements, etc. would get that garbled text when using apostrophes and ampersands. With whispers trim is on the "inside", with stripped_input that is used for these announcements trim is on the "outside". It makes intuitive sense to me that whoever wrote that stripped_input comment might have gotten things flipped since if trim is on the inside, and it allows single symbols to pass through, then there's nothing to filter html_encode from spewing that garbage out. If this isn't the correct fix then at least I should be close enough that someone can point me in the right direction. --- code/__HELPERS/text.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index 264f8cc73f1..27f8526c2e1 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -76,7 +76,7 @@ // Used to get a properly sanitized input, of max_length /proc/stripped_input(mob/user, message = "", title = "", default = "", max_length=MAX_MESSAGE_LEN) var/name = input(user, message, title, default) as text|null - return html_encode(trim(name, max_length)) //trim is "inside" because html_encode can expand single symbols into multiple symbols (such as turning < into <) + return trim(html_encode(name), max_length) //trim is "outside" because html_encode can expand single symbols into multiple symbols (such as turning < into <) // Used to get a properly sanitized multiline input, of max_length /proc/stripped_multiline_input(mob/user, message = "", title = "", default = "", max_length=MAX_MESSAGE_LEN) @@ -411,4 +411,4 @@ var/list/binary = list("0","1") t = replacetext(t, "\[list\]", "") - return t \ No newline at end of file + return t