From 56ffda98293de2e8f4275546219757d26b7bc059 Mon Sep 17 00:00:00 2001 From: farie82 Date: Sun, 16 Feb 2020 00:51:19 +0100 Subject: [PATCH] stripped_input now actually uses the max length at all times (#12983) --- code/__HELPERS/text.dm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index 0f356aa4f4a..db41b411d12 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -108,11 +108,10 @@ // Used to get a sanitized input. /proc/stripped_input(mob/user, message = "", title = "", default = "", max_length=MAX_MESSAGE_LEN, no_trim=FALSE) - var/name = input(user, message, title, default) as text|null - if(no_trim) - return copytext(html_encode(name), 1, max_length) - else - return trim(html_encode(name), max_length) //trim is "outside" because html_encode can expand single symbols into multiple symbols (such as turning < into <) + var/name = html_encode(input(user, message, title, default) as text|null) + if(!no_trim) + name = trim(name) //trim is "outside" because html_encode can expand single symbols into multiple symbols (such as turning < into <) + return copytext(name, 1, max_length) // Uses client.typing to check if the popup should appear or not /proc/typing_input(mob/user, message = "", title = "", default = "")