diff --git a/code/controllers/subsystem/voting.dm b/code/controllers/subsystem/voting.dm index b10042486f9..9fb28c1f174 100644 --- a/code/controllers/subsystem/voting.dm +++ b/code/controllers/subsystem/voting.dm @@ -149,10 +149,10 @@ var/datum/subsystem/vote/SSvote if("restart") choices.Add("Restart Round","Continue Playing") if("gamemode") choices.Add(config.votable_modes) if("custom") - question = html_encode(input(usr,"What is the vote for?") as text|null) + question = stripped_input(usr,"What is the vote for?") if(!question) return 0 for(var/i=1,i<=10,i++) - var/option = capitalize(html_encode(input(usr,"Please enter an option or hit cancel to finish") as text|null)) + var/option = capitalize(stripped_input(usr,"Please enter an option or hit cancel to finish")) if(!option || mode || !usr.client) break choices.Add(option) else return 0 diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index c072fc6ae39..522fdb10ceb 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -466,7 +466,7 @@ body usr << "This can only be used on instances of type /mob" return - var/new_name = copytext(sanitize(input(usr,"What would you like to name this mob?","Input a name",M.real_name) as text|null),1,MAX_NAME_LEN) + var/new_name = stripped_input(usr,"What would you like to name this mob?","Input a name",M.real_name,MAX_NAME_LEN) if( !new_name || !M ) return message_admins("Admin [key_name_admin(usr)] renamed [key_name_admin(M)] to [new_name].") diff --git a/code/datums/mind.dm b/code/datums/mind.dm index af8be78dce7..9f1c9b517ed 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -634,7 +634,7 @@ new_objective.target_amount = target_number if ("custom") - var/expl = copytext(sanitize(input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null),1,MAX_MESSAGE_LEN) + var/expl = stripped_input(usr, "Custom objective:", "Objective", objective ? objective.explanation_text : "") if (!expl) return new_objective = new /datum/objective new_objective.owner = src diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 523ccd0d4f9..c02b72338b0 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -345,7 +345,7 @@ datum/objective/steal/proc/select_target() //For admins setting objectives manua var/tmp_obj = new custom_target var/custom_name = tmp_obj:name qdel(tmp_obj) - custom_name = copytext(sanitize(input("Enter target name:", "Objective target", custom_name) as text|null),1,MAX_MESSAGE_LEN) + custom_name = stripped_input("Enter target name:", "Objective target", custom_name) if (!custom_name) return steal_target = custom_target explanation_text = "Steal [custom_name]." diff --git a/code/game/gamemodes/sandbox/airlock_maker.dm b/code/game/gamemodes/sandbox/airlock_maker.dm index 3fb4cd2c788..7a8f7beb7c7 100644 --- a/code/game/gamemodes/sandbox/airlock_maker.dm +++ b/code/game/gamemodes/sandbox/airlock_maker.dm @@ -75,7 +75,7 @@ datum/airlock_maker/Topic(var/href,var/list/href_list) return if("rename" in href_list) - var/newname = input(usr,"New airlock name:","Name the airlock",doorname) as null|text + var/newname = stripped_input(usr,"New airlock name:","Name the airlock",doorname) if(newname) doorname = newname if("access" in href_list) diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm index 7ee8a0a8bda..914046a5649 100644 --- a/code/game/machinery/bots/mulebot.dm +++ b/code/game/machinery/bots/mulebot.dm @@ -324,7 +324,7 @@ obj/machinery/bot/mulebot/bot_reset() if("setid") refresh=0 - var/new_id = copytext(sanitize(input("Enter new bot ID", "Mulebot [suffix ? "([suffix])" : ""]", suffix) as text|null),1,MAX_NAME_LEN) + var/new_id = stripped_input(usr, "Enter new bot ID", "Mulebot [suffix ? "([suffix])" : ""]", suffix, MAX_NAME_LEN) refresh=1 if(new_id) suffix = new_id @@ -333,7 +333,7 @@ obj/machinery/bot/mulebot/bot_reset() if("sethome") refresh=0 - var/new_home = input("Enter new home tag", "Mulebot [suffix ? "([suffix])" : ""]", home_destination) as text|null + var/new_home = stripped_input(usr, "Enter new home tag", "Mulebot [suffix ? "([suffix])" : ""]", home_destination) refresh=1 if(new_home) home_destination = new_home diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index a35235d51a1..d673cf214a5 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -467,7 +467,7 @@ src.active2.fields[text("com_[]", href_list["del_c"])] = "Deleted" else if (href_list["search"]) - var/t1 = input("Search String: (Name, DNA, or ID)", "Med. records", null, null) as text + var/t1 = stripped_input(usr, "Search String: (Name, DNA, or ID)", "Med. records") if ((!( t1 ) || usr.stat || !( src.authenticated ) || usr.restrained() || ((!in_range(src, usr)) && (!istype(usr, /mob/living/silicon))))) return src.active1 = null diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm index 56e48b07b65..c96d9a79714 100644 --- a/code/game/machinery/computer/message.dm +++ b/code/game/machinery/computer/message.dm @@ -417,7 +417,7 @@ //Select Your Name if("Sender") - customsender = input(usr, "Please enter the sender's name.") as text|null + customsender = stripped_input(usr, "Please enter the sender's name.") //Select Receiver if("Recepient") @@ -430,12 +430,11 @@ //Enter custom job if("RecJob") - customjob = input(usr, "Please enter the sender's job.") as text|null + customjob = stripped_input(usr, "Please enter the sender's job.") //Enter message if("Message") - custommessage = input(usr, "Please enter your message.") as text|null - custommessage = copytext(sanitize(custommessage), 1, MAX_MESSAGE_LEN) + custommessage = stripped_input(usr, "Please enter your message.") //Send message if("Send") diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 5fe0b91cc05..6b4d124790f 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -514,7 +514,7 @@ What a mess.*/ switch(href_list["field"]) if("name") if (istype(active1, /datum/data/record) || istype(active2, /datum/data/record)) - var/t1 = input("Please input name:", "Secure. records", active1.fields["name"], null) as text + var/t1 = stripped_input(usr, "Please input name:", "Secure. records", active1.fields["name"], null) if ((!( t1 ) || !length(trim(t1)) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon)))) || active1 != a1) return if(istype(active1, /datum/data/record)) diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index b2ee6d682c3..917f519e5b7 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -204,12 +204,12 @@ Transponder Codes: