From 90bbc01cf45b7070b6237bfcb6a160a4e315b2bb Mon Sep 17 00:00:00 2001 From: Tayyyyyyy Date: Sun, 11 Aug 2019 22:40:16 -0700 Subject: [PATCH] Fix input sanitization issues --- code/modules/admin/verbs/adminhelp.dm | 2 +- code/modules/admin/verbs/adminpm.dm | 2 +- code/modules/admin/verbs/randomverbs.dm | 2 +- code/modules/mob/mob_helpers.dm | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index 4aceade3526..853b367e15b 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -27,7 +27,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey"," if(handle_spam_prevention(msg, MUTE_ADMINHELP, OOC_COOLDOWN)) return - msg = sanitize(copytext(msg,1,MAX_MESSAGE_LEN)) + msg = sanitize_simple(copytext(msg,1,MAX_MESSAGE_LEN)) if(!msg) return var/original_msg = msg diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index 0b7632595e8..1d35a621217 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -106,7 +106,7 @@ //clean the message if it's not sent by a high-rank admin if(!check_rights(R_SERVER|R_DEBUG,0)) - msg = sanitize(copytext(msg,1,MAX_MESSAGE_LEN)) + msg = sanitize_simple(copytext(msg,1,MAX_MESSAGE_LEN)) if(!msg) return else diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index ae44648b5d5..6a4d1e8dc18 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -613,7 +613,7 @@ Traitors and the like can also be revived with the previous role mostly intact. var/input = input(usr, "Please enter anything you want. Anything. Serious.", "What's the message?") as message|null if(!input) return - input = pencode_to_html(html_encode(input)) + input = html_encode(input) switch(alert("Should this be announced to the general population?",,"Yes","No", "Cancel")) if("Yes") diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 279610f0925..49785ff103f 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -569,7 +569,7 @@ var/list/intents = list(INTENT_HELP,INTENT_DISARM,INTENT_GRAB,INTENT_HARM) if(force) newname = clean_input("Pick a new name.", "Name Change", oldname, src) else - newname = input("You are a [role]. Would you like to change your name to something else? (You have 3 minutes to select a new name.)", "Name Change", oldname, src) + newname = clean_input("You are a [role]. Would you like to change your name to something else? (You have 3 minutes to select a new name.)", "Name Change", oldname, src) if(((world.time - time_passed) > 1800) && !force) alert(src, "Unfortunately, more than 3 minutes have passed for selecting your name. If you are a robot, use the Namepick verb; otherwise, adminhelp.", "Name Change") return //took too long