stripped_input now actually uses the max length at all times (#12983)

This commit is contained in:
farie82
2020-02-15 16:51:19 -07:00
committed by GitHub
parent 295ab9e82c
commit 56ffda9829
+4 -5
View File
@@ -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 &lt;)
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 &lt;)
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 = "")