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:
"}
else if(href_list["edit"])
var/codekey = href_list["code"]
- var/newkey = input("Enter Transponder Code Key", "Navigation Beacon", codekey) as text|null
+ var/newkey = stripped_input(usr, "Enter Transponder Code Key", "Navigation Beacon", codekey)
if(!newkey)
return
var/codeval = codes[codekey]
- var/newval = input("Enter Transponder Code Value", "Navigation Beacon", codeval) as text|null
+ var/newval = stripped_input(usr, "Enter Transponder Code Value", "Navigation Beacon", codeval)
if(!newval)
newval = codekey
return
@@ -226,11 +226,11 @@ Transponder Codes:"}
else if(href_list["add"])
- var/newkey = input("Enter New Transponder Code Key", "Navigation Beacon") as text|null
+ var/newkey = stripped_input(usr, "Enter New Transponder Code Key", "Navigation Beacon")
if(!newkey)
return
- var/newval = input("Enter New Transponder Code Value", "Navigation Beacon") as text|null
+ var/newval = stripped_input(usr, "Enter New Transponder Code Value", "Navigation Beacon")
if(!newval)
newval = "1"
return
diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm
index 12bec635546..35ee5e7bad4 100644
--- a/code/game/machinery/portable_turret.dm
+++ b/code/game/machinery/portable_turret.dm
@@ -792,8 +792,7 @@
return
if(istype(I, /obj/item/weapon/pen)) //you can rename turrets like bots!
- var/t = input(user, "Enter new turret name", name, finish_name) as text
- t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN)
+ var/t = stripped_input(user, "Enter new turret name", name, finish_name)
if(!t)
return
if(!in_range(src, usr) && loc != usr)
diff --git a/code/game/machinery/telecomms/logbrowser.dm b/code/game/machinery/telecomms/logbrowser.dm
index 54ae64a7ca6..829af0c35d1 100644
--- a/code/game/machinery/telecomms/logbrowser.dm
+++ b/code/game/machinery/telecomms/logbrowser.dm
@@ -204,7 +204,7 @@
if(href_list["network"])
- var/newnet = input(usr, "Which network do you want to view?", "Comm Monitor", network) as null|text
+ var/newnet = stripped_input(usr, "Which network do you want to view?", "Comm Monitor", network)
if(newnet && ((usr in range(1, src) || issilicon(usr))))
if(length(newnet) > 15)
diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm
index bfb60668ac4..843430a8201 100644
--- a/code/game/machinery/telecomms/machine_interactions.dm
+++ b/code/game/machinery/telecomms/machine_interactions.dm
@@ -308,7 +308,7 @@
temp = "-% New ID assigned: \"[id]\" %-"
if("network")
- var/newnet = input(usr, "Specify the new network for this machine. This will break all current links.", src, network) as null|text
+ var/newnet = stripped_input(usr, "Specify the new network for this machine. This will break all current links.", src, network)
if(newnet && canAccess(usr))
if(length(newnet) > 15)
diff --git a/code/game/machinery/telecomms/telemonitor.dm b/code/game/machinery/telecomms/telemonitor.dm
index e0fc7feb89a..4943a70429a 100644
--- a/code/game/machinery/telecomms/telemonitor.dm
+++ b/code/game/machinery/telecomms/telemonitor.dm
@@ -110,7 +110,7 @@
if(href_list["network"])
- var/newnet = input(usr, "Which network do you want to view?", "Comm Monitor", network) as null|text
+ var/newnet = stripped_input(usr, "Which network do you want to view?", "Comm Monitor", network)
if(newnet && ((usr in range(1, src) || issilicon(usr))))
if(length(newnet) > 15)
temp = "- FAILED: NETWORK TAG STRING TOO LENGHTLY -"
diff --git a/code/game/machinery/telecomms/traffic_control.dm b/code/game/machinery/telecomms/traffic_control.dm
index ff10904ee83..d00a030350c 100644
--- a/code/game/machinery/telecomms/traffic_control.dm
+++ b/code/game/machinery/telecomms/traffic_control.dm
@@ -256,7 +256,7 @@
if(href_list["network"])
- var/newnet = input(usr, "Which network do you want to view?", "Comm Monitor", network) as null|text
+ var/newnet = stripped_input(usr, "Which network do you want to view?", "Comm Monitor", network)
if(newnet && canAccess(usr))
if(length(newnet) > 15)
diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm
index 153ce9426ce..3308b7266c1 100644
--- a/code/game/objects/items/bodybag.dm
+++ b/code/game/objects/items/bodybag.dm
@@ -44,12 +44,11 @@
/obj/structure/closet/body_bag/attackby(obj/item/I, mob/user)
if (istype(I, /obj/item/weapon/pen))
- var/t = input(user, "What would you like the label to be?", name, null) as text
+ var/t = stripped_input(user, "What would you like the label to be?", name, null, 53)
if(user.get_active_hand() != I)
return
if(!in_range(src, user) && loc != user)
return
- t = copytext(sanitize(t), 1, 53) //max length of 64 - "body bag - " instead of MAX_MESSAGE_LEN, as per the hand labeler
if(t)
name = "body bag - "
name += t
diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm
index a014fd5d33c..9e2096f90cd 100644
--- a/code/game/objects/items/devices/PDA/PDA.dm
+++ b/code/game/objects/items/devices/PDA/PDA.dm
@@ -631,11 +631,10 @@ var/global/list/obj/item/device/pda/PDAs = list()
//CHATROOM FUNCTIONS====================================
if("Set Nick")
- var/t = stripped_input(U, "Please enter nickname", name, null) as text
- nick = copytext(sanitize(t), 1, 9)
+ var/t = stripped_input(U, "Please enter nickname", name, null, 8)
if("Set Channel")
- var/t = stripped_input(U, "Please enter channel", name, (chat_channel)) as text
+ var/t = stripped_input(U, "Please enter channel", name, chat_channel)
if(t)
var/datum/chatroom/C = chatchannels[chat_channel]
diff --git a/code/game/objects/items/weapons/implants/implantcase.dm b/code/game/objects/items/weapons/implants/implantcase.dm
index 1f3eaabde89..e2effcc942d 100644
--- a/code/game/objects/items/weapons/implants/implantcase.dm
+++ b/code/game/objects/items/weapons/implants/implantcase.dm
@@ -19,12 +19,11 @@
/obj/item/weapon/implantcase/attackby(obj/item/weapon/W, mob/user)
..()
if(istype(W, /obj/item/weapon/pen))
- var/t = input(user, "What would you like the label to be?", name, null) as text
+ var/t = stripped_input(user, "What would you like the label to be?", name, null)
if(user.get_active_hand() != W)
return
if(!in_range(src, user) && loc != user)
return
- t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN)
if(t)
name = "glass case- '[t]'"
else
diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm
index fd314a167c3..e31a3edd71a 100644
--- a/code/game/objects/structures/morgue.dm
+++ b/code/game/objects/structures/morgue.dm
@@ -59,12 +59,11 @@
/obj/structure/bodycontainer/attackby(P as obj, mob/user as mob)
if (istype(P, /obj/item/weapon/pen))
- var/t = input(user, "What would you like the label to be?", text("[]", name), null) as text
+ var/t = stripped_input(user, "What would you like the label to be?", text("[]", name), null)
if (user.get_active_hand() != P)
return
if ((!in_range(src, usr) && src.loc != user))
return
- t = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
if (t)
name = text("[]- '[]'", initial(name), t)
else
diff --git a/code/modules/food&drinks/food/snacks_pizza.dm b/code/modules/food&drinks/food/snacks_pizza.dm
index 66a1ec7b98f..2469d35fbb1 100644
--- a/code/modules/food&drinks/food/snacks_pizza.dm
+++ b/code/modules/food&drinks/food/snacks_pizza.dm
@@ -228,13 +228,13 @@
if(open )
return
- var/t = input("Enter what you want to add to the tag:", "Write", null, null) as text
+ var/t = stripped_input(user, "Enter what you want to add to the tag:", "Write", "", 30)
var/obj/item/pizzabox/boxtotagto = src
if(boxes.len > 0)
boxtotagto = boxes[boxes.len]
- boxtotagto.boxtag = copytext("[boxtotagto.boxtag][t]", 1, 30)
+ boxtotagto.boxtag = "[boxtotagto.boxtag][t]"
update_icon()
return