diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm
index 320e2ecd8d7..81ed859a7e5 100644
--- a/code/__HELPERS/mobs.dm
+++ b/code/__HELPERS/mobs.dm
@@ -132,6 +132,8 @@ Proc for attack log creation, because really why not
proc/add_logs(mob/target, mob/user, what_done, var/object=null, var/addition=null)
var/list/ignore=list("shaked","CPRed","grabbed","punched")
+ if(!user)
+ return
if(ismob(user))
user.attack_log += text("\[[time_stamp()]\] Has [what_done] [target.name][ismob(target) ? "([target.ckey])" : ""][object ? " with [object]" : " "][addition]")
if(ismob(target))
diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm
index 108246c5ad5..c6cd633398b 100644
--- a/code/__HELPERS/text.dm
+++ b/code/__HELPERS/text.dm
@@ -34,12 +34,9 @@
return t
//Removes a few problematic characters
-/proc/sanitize_simple(var/t,var/list/repl_chars = list("\n"="#","\t"="#","�"="�"))
+/proc/sanitize_simple(var/t,var/list/repl_chars = list("\n"="#","\t"="#"))
for(var/char in repl_chars)
- var/index = findtext(t, char)
- while(index)
- t = copytext(t, 1, index) + repl_chars[char] + copytext(t, index+1)
- index = findtext(t, char)
+ replacetext(t, char, repl_chars[char])
return t
/proc/readd_quotes(var/t)
diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm
index d202f29d8f9..a7db9300c73 100644
--- a/code/datums/datumvars.dm
+++ b/code/datums/datumvars.dm
@@ -441,7 +441,7 @@ client
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 = sanitize(copytext(input(usr,"What would you like to name this mob?","Input a name",M.real_name) as text|null,1,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 caea97b2f7d..527ea37bb14 100644
--- a/code/datums/mind.dm
+++ b/code/datums/mind.dm
@@ -446,7 +446,7 @@ datum/mind
assigned_role = new_role
else if (href_list["memory_edit"])
- var/new_memo = copytext(sanitize(input("Write new memory", "Memory", memory) as null|message),1,MAX_MESSAGE_LEN)
+ var/new_memo = sanitize(copytext(input("Write new memory", "Memory", memory) as null|message,1,MAX_MESSAGE_LEN))
if (isnull(new_memo)) return
memory = new_memo
@@ -585,7 +585,7 @@ datum/mind
new_objective.find_target()
if ("custom")
- var/expl = copytext(sanitize(input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null),1,MAX_MESSAGE_LEN)
+ var/expl = sanitize(copytext(input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null,1,MAX_MESSAGE_LEN))
if (!expl) return
new_objective = new /datum/objective
new_objective.owner = src
diff --git a/code/game/gamemodes/blob/overmind.dm b/code/game/gamemodes/blob/overmind.dm
index 8316c570f9a..5f3b1bf796e 100644
--- a/code/game/gamemodes/blob/overmind.dm
+++ b/code/game/gamemodes/blob/overmind.dm
@@ -65,7 +65,7 @@
/mob/camera/blob/proc/blob_talk(message)
log_say("[key_name(src)] : [message]")
- message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
+ message = trim(sanitize(copytext(message, 1, MAX_MESSAGE_LEN)))
if (!message)
return
diff --git a/code/game/gamemodes/events/ninja_equipment.dm b/code/game/gamemodes/events/ninja_equipment.dm
index 95b3243ae84..a02fc5042e7 100644
--- a/code/game/gamemodes/events/ninja_equipment.dm
+++ b/code/game/gamemodes/events/ninja_equipment.dm
@@ -564,7 +564,7 @@ ________________________________________________________________________________
if("Message")
var/obj/item/device/pda/P = locate(href_list["target"])
var/t = input(U, "Please enter untraceable message.") as text
- t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN)
+ t = sanitize(copytext(t, 1, MAX_MESSAGE_LEN))
if(!t||U.stat||U.wear_suit!=src||!s_initialized)//Wow, another one of these. Man...
display_to << browse(null, "window=spideros")
return
diff --git a/code/game/gamemodes/events/space_ninja.dm b/code/game/gamemodes/events/space_ninja.dm
index 9a17a188ec0..1792e573a5b 100644
--- a/code/game/gamemodes/events/space_ninja.dm
+++ b/code/game/gamemodes/events/space_ninja.dm
@@ -480,7 +480,7 @@ As such, it's hard-coded for now. No reason for it not to be, really.
var/mission
if(alert("Would you the Ninja to have a random or preset mission?",,"Random","Preset")=="Preset")
while(!mission)
- mission = copytext(sanitize(input(src, "Please specify which mission the space ninja shall undertake.", "Specify Mission", "")),1,MAX_MESSAGE_LEN)
+ mission = sanitize(copytext(input(src, "Please specify which mission the space ninja shall undertake.", "Specify Mission", ""),1,MAX_MESSAGE_LEN))
if(!mission)
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
return
diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm
index 6deb483f0fa..de5d25bd9d1 100644
--- a/code/game/gamemodes/nuclear/nuclear.dm
+++ b/code/game/gamemodes/nuclear/nuclear.dm
@@ -441,7 +441,7 @@ proc/issyndicate(mob/living/M as mob)
/proc/nukelastname(var/mob/M as mob) //--All praise goes to NEO|Phyte, all blame goes to DH, and it was Cindi-Kate's idea. Also praise Urist for copypasta ho.
var/randomname = pick(last_names)
- var/newname = copytext(sanitize(input(M,"You are the nuke operative [pick("Czar", "Boss", "Commander", "Chief", "Kingpin", "Director", "Overlord")]. Please choose a last name for your family.", "Name change",randomname)),1,MAX_NAME_LEN)
+ var/newname = sanitize(copytext(input(M,"You are the nuke operative [pick("Czar", "Boss", "Commander", "Chief", "Kingpin", "Director", "Overlord")]. Please choose a last name for your family.", "Name change",randomname),1,MAX_NAME_LEN))
if (!newname)
newname = randomname
diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm
index af9cfac6fbe..2a7d8b14368 100644
--- a/code/game/gamemodes/objective.dm
+++ b/code/game/gamemodes/objective.dm
@@ -619,7 +619,7 @@ datum/objective/steal
var/tmp_obj = new O.typepath
var/custom_name = tmp_obj:name
del(tmp_obj)
- O.name = copytext(sanitize(input("Enter target name:", "Objective target", custom_name) as text|null),1,MAX_NAME_LEN)
+ O.name = sanitize(copytext(input("Enter target name:", "Objective target", custom_name) as text|null,1,MAX_NAME_LEN))
if (!O.name) return
steal_target = O
explanation_text = "Steal [O.name]."
diff --git a/code/game/gamemodes/wizard/artefact.dm b/code/game/gamemodes/wizard/artefact.dm
index b0471908eaf..4bda30ebe02 100644
--- a/code/game/gamemodes/wizard/artefact.dm
+++ b/code/game/gamemodes/wizard/artefact.dm
@@ -87,7 +87,7 @@
var/wizard_name_first = pick(wizard_first)
var/wizard_name_second = pick(wizard_second)
var/randomname = "[wizard_name_first] [wizard_name_second]"
- var/newname = copytext(sanitize(input(M, "You are the wizard's apprentice. Would you like to change your name to something else?", "Name change", randomname) as null|text),1,MAX_NAME_LEN)
+ var/newname = sanitize(copytext(input(M, "You are the wizard's apprentice. Would you like to change your name to something else?", "Name change", randomname) as null|text,1,MAX_NAME_LEN))
if (!newname)
newname = randomname
diff --git a/code/game/gamemodes/wizard/wizard.dm b/code/game/gamemodes/wizard/wizard.dm
index cd59d23d0b5..78be858d796 100644
--- a/code/game/gamemodes/wizard/wizard.dm
+++ b/code/game/gamemodes/wizard/wizard.dm
@@ -116,7 +116,7 @@
var/wizard_name_second = pick(wizard_second)
var/randomname = "[wizard_name_first] [wizard_name_second]"
spawn(0)
- var/newname = copytext(sanitize(input(wizard_mob, "You are the Space Wizard. Would you like to change your name to something else?", "Name change", randomname) as null|text),1,MAX_NAME_LEN)
+ var/newname = sanitize(copytext(input(wizard_mob, "You are the Space Wizard. Would you like to change your name to something else?", "Name change", randomname) as null|text,1,MAX_NAME_LEN))
if (!newname)
newname = randomname
diff --git a/code/game/jobs/job/support_chaplain.dm b/code/game/jobs/job/support_chaplain.dm
index f02f111c0fb..d56f478fc42 100644
--- a/code/game/jobs/job/support_chaplain.dm
+++ b/code/game/jobs/job/support_chaplain.dm
@@ -24,7 +24,7 @@
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
spawn(0)
var/religion_name = "Christianity"
- var/new_religion = copytext(sanitize(input(H, "You are the crew services officer. Would you like to change your religion? Default is Christianity, in SPACE.", "Name change", religion_name)),1,MAX_NAME_LEN)
+ var/new_religion = sanitize(copytext(input(H, "You are the crew services officer. Would you like to change your religion? Default is Christianity, in SPACE.", "Name change", religion_name),1,MAX_NAME_LEN))
if (!new_religion)
new_religion = religion_name
@@ -59,7 +59,7 @@
spawn(1)
var/deity_name = "Space Jesus"
- var/new_deity = copytext(sanitize(input(H, "Would you like to change your deity? Default is Space Jesus.", "Name change", deity_name)),1,MAX_NAME_LEN)
+ var/new_deity = sanitize(copytext(input(H, "Would you like to change your deity? Default is Space Jesus.", "Name change", deity_name),1,MAX_NAME_LEN))
if ((length(new_deity) == 0) || (new_deity == "Space Jesus") )
new_deity = deity_name
diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm
index 17492a83ba4..8ae1166ff29 100644
--- a/code/game/machinery/atmoalter/canister.dm
+++ b/code/game/machinery/atmoalter/canister.dm
@@ -470,7 +470,7 @@ update_flag
if (href_list["rename"])
if (can_label)
- var/T = copytext(sanitize(input("Choose canister label", "Name", name) as text|null),1,MAX_NAME_LEN)
+ var/T = sanitize(copytext(input("Choose canister label", "Name", name) as text|null,1,MAX_NAME_LEN))
if (can_label) //Exploit prevention
if (T)
name = T
diff --git a/code/game/machinery/bots/farmbot.dm b/code/game/machinery/bots/farmbot.dm
index 3c13b04ff96..d5eff718549 100644
--- a/code/game/machinery/bots/farmbot.dm
+++ b/code/game/machinery/bots/farmbot.dm
@@ -585,7 +585,7 @@
else if(istype(W, /obj/item/weapon/pen))
var/t = input(user, "Enter new robot name", src.name, src.created_name) as text
- t = copytext(sanitize(t), 1, MAX_NAME_LEN)
+ t = sanitize(copytext(t), 1, MAX_NAME_LEN)
if (!t)
return
if (!in_range(src, usr) && src.loc != usr)
diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm
index 4e15b07fe01..bbab6f7d9e7 100644
--- a/code/game/machinery/bots/mulebot.dm
+++ b/code/game/machinery/bots/mulebot.dm
@@ -324,7 +324,7 @@ var/global/mulebot_count = 0
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 = sanitize(copytext(input("Enter new bot ID", "Mulebot [suffix ? "([suffix])" : ""]", suffix) as text|null,1,MAX_NAME_LEN))
refresh=1
if(new_id)
suffix = new_id
diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm
index 6298f0d7d89..87552942026 100644
--- a/code/game/machinery/computer/card.dm
+++ b/code/game/machinery/computer/card.dm
@@ -198,7 +198,7 @@
if (is_authenticated() && modify)
var/t1 = href_list["assign_target"]
if(t1 == "Custom")
- var/temp_t = copytext(sanitize(input("Enter a custom job assignment.","Assignment")),1,MAX_MESSAGE_LEN)
+ var/temp_t = sanitize(copytext(input("Enter a custom job assignment.","Assignment"),1,MAX_MESSAGE_LEN))
//let custom jobs function as an impromptu alt title, mainly for sechuds
if(temp_t && modify)
modify.assignment = temp_t
diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm
index 916b99e05c9..879e6b8f150 100644
--- a/code/game/machinery/computer/message.dm
+++ b/code/game/machinery/computer/message.dm
@@ -422,7 +422,7 @@
//Enter message
if("Message")
custommessage = input(usr, "Please enter your message.") as text|null
- custommessage = copytext(sanitize(custommessage), 1, MAX_MESSAGE_LEN)
+ custommessage = sanitize(copytext(custommessage, 1, MAX_MESSAGE_LEN))
//Send message
if("Send")
diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm
index 8340838f6e2..7b4b37665b0 100644
--- a/code/game/machinery/computer/prisoner.dm
+++ b/code/game/machinery/computer/prisoner.dm
@@ -129,7 +129,7 @@
usr << "Unauthorized Access."
else if(href_list["warn"])
- var/warning = copytext(sanitize(input(usr,"Message:","Enter your message here!","")),1,MAX_MESSAGE_LEN)
+ var/warning = sanitize(copytext(input(usr,"Message:","Enter your message here!",""),1,MAX_MESSAGE_LEN))
if(!warning) return
var/obj/item/weapon/implant/I = locate(href_list["warn"])
if((I)&&(I.imp_in))
diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm
index a2dd432d991..8569ede3fd7 100644
--- a/code/game/machinery/magnet.dm
+++ b/code/game/machinery/magnet.dm
@@ -323,7 +323,7 @@
if(speed <= 0)
speed = 1
if("setpath")
- var/newpath = copytext(sanitize(input(usr, "Please define a new path!",,path) as text|null),1,MAX_MESSAGE_LEN)
+ var/newpath = sanitize(copytext(input(usr, "Please define a new path!",,path) as text|null,1,MAX_MESSAGE_LEN))
if(newpath && newpath != "")
moving = 0 // stop moving
path = newpath
diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm
index 59bf0f2ea17..414c6c365b1 100644
--- a/code/game/machinery/navbeacon.dm
+++ b/code/game/machinery/navbeacon.dm
@@ -193,7 +193,7 @@ Transponder Codes:
"}
updateDialog()
else if(href_list["locedit"])
- var/newloc = copytext(sanitize(input("Enter New Location", "Navigation Beacon", location) as text|null),1,MAX_MESSAGE_LEN)
+ var/newloc = sanitize(copytext(input("Enter New Location", "Navigation Beacon", location) as text|null,1,MAX_MESSAGE_LEN))
if(newloc)
location = newloc
updateDialog()
diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm
index dd0e408fd60..85b4e35f7af 100644
--- a/code/game/machinery/newscaster.dm
+++ b/code/game/machinery/newscaster.dm
@@ -944,7 +944,7 @@ obj/item/weapon/newspaper/attackby(obj/item/weapon/W as obj, mob/user as mob)
user << "There's already a scribble in this page... You wouldn't want to make things too cluttered, would you?"
else
var/s = strip_html( input(user, "Write something", "Newspaper", "") )
- s = copytext(sanitize(s), 1, MAX_MESSAGE_LEN)
+ s = sanitize(copytext(s, 1, MAX_MESSAGE_LEN))
if (!s)
return
if (!in_range(src, usr) && src.loc != usr)
diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm
index f4829b57416..464144d832d 100644
--- a/code/game/machinery/portable_turret.dm
+++ b/code/game/machinery/portable_turret.dm
@@ -848,7 +848,7 @@ Status: []
"},
if (istype(W, /obj/item/weapon/pen)) // you can rename turrets like bots!
var/t = input(user, "Enter new turret name", src.name, src.finish_name) as text
- t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN)
+ t = sanitize(copytext(t, 1, MAX_MESSAGE_LEN))
if (!t)
return
if (!in_range(src, usr) && src.loc != usr)
diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm
index 3ff89c5fd60..0bb680f069d 100644
--- a/code/game/objects/items/bodybag.dm
+++ b/code/game/objects/items/bodybag.dm
@@ -47,7 +47,7 @@
return
if (!in_range(src, user) && src.loc != user)
return
- t = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
+ t = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
if (t)
src.name = "body bag - "
src.name += t
diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm
index 728ecb5e9f7..a2d06058e08 100755
--- a/code/game/objects/items/devices/PDA/PDA.dm
+++ b/code/game/objects/items/devices/PDA/PDA.dm
@@ -689,7 +689,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
U << "The PDA softly beeps."
ui.close()
else
- t = copytext(sanitize(t), 1, 20)
+ t = sanitize(copytext(t, 1, 20))
ttone = t
else
ui.close()
@@ -897,7 +897,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
/obj/item/device/pda/proc/create_message(var/mob/living/U = usr, var/obj/item/device/pda/P)
var/t = input(U, "Please enter message", name, null) as text
- t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN)
+ t = sanitize(copytext(t, 1, MAX_MESSAGE_LEN))
t = readd_quotes(t)
if (!t || !istype(P))
return
diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm
index 09b5201fdb0..fe322e30dbd 100644
--- a/code/game/objects/items/devices/flash.dm
+++ b/code/game/objects/items/devices/flash.dm
@@ -66,10 +66,11 @@
if(user && convert)
terrible_conversion_proc(M, user)
M.Stun(1)
- user.visible_message("[user] blinds [M] with the flash!")
+ user.visible_message("[user] blinds [M] with the flash!")
return 1
else
- user.visible_message("[user] fails to blind [M] with the flash!")
+ if(user)
+ user.visible_message("[user] fails to blind [M] with the flash!")
return 0
/obj/item/device/flash/attack(mob/living/M, mob/user)
diff --git a/code/game/objects/items/devices/megaphone.dm b/code/game/objects/items/devices/megaphone.dm
index 3968ee1a441..11f706f01ba 100644
--- a/code/game/objects/items/devices/megaphone.dm
+++ b/code/game/objects/items/devices/megaphone.dm
@@ -26,7 +26,7 @@
user << "\red \The [src] needs to recharge!"
return
- var/message = copytext(sanitize(input(user, "Shout a message?", "Megaphone", null) as text),1,MAX_MESSAGE_LEN)
+ var/message = sanitize(copytext(input(user, "Shout a message?", "Megaphone", null) as text,1,MAX_MESSAGE_LEN))
if(!message)
return
message = capitalize(message)
diff --git a/code/game/objects/items/devices/paicard.dm b/code/game/objects/items/devices/paicard.dm
index e184b0fb066..b5d14aa8982 100644
--- a/code/game/objects/items/devices/paicard.dm
+++ b/code/game/objects/items/devices/paicard.dm
@@ -265,7 +265,7 @@
if(2)
radio.ToggleReception()
if(href_list["setlaws"])
- var/newlaws = copytext(sanitize(input("Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.pai_laws) as message),1,MAX_MESSAGE_LEN)
+ var/newlaws = sanitize(copytext(input("Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.pai_laws) as message,1,MAX_MESSAGE_LEN))
if(newlaws)
pai.pai_laws = newlaws
pai << "Your supplemental directives have been updated. Your new directives are:"
diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm
index dd849488a3b..86d90735ad6 100644
--- a/code/game/objects/items/weapons/cards_ids.dm
+++ b/code/game/objects/items/weapons/cards_ids.dm
@@ -250,7 +250,7 @@
return
src.registered_name = t
- var u = copytext(sanitize(input(user, "What occupation would you like to put on this card?\nNote: This will not grant any access levels other than Maintenance.", "Agent card job assignment", "Civilian")),1,MAX_MESSAGE_LEN)
+ var u = sanitize(copytext(input(user, "What occupation would you like to put on this card?\nNote: This will not grant any access levels other than Maintenance.", "Agent card job assignment", "Civilian"),1,MAX_MESSAGE_LEN))
if(!u)
alert("Invalid assignment.")
src.registered_name = ""
@@ -265,13 +265,13 @@
switch(alert("Would you like to display the ID, or retitle it?","Choose.","Rename","Show"))
if("Rename")
- var t = copytext(sanitize(input(user, "What name would you like to put on this card?", "Agent card name", ishuman(user) ? user.real_name : user.name)),1,26)
+ var t = sanitize(copytext(input(user, "What name would you like to put on this card?", "Agent card name", ishuman(user) ? user.real_name : user.name),1,26))
if(!t || t == "Unknown" || t == "floor" || t == "wall" || t == "r-wall") //Same as mob/new_player/prefrences.dm
alert("Invalid name.")
return
src.registered_name = t
- var u = copytext(sanitize(input(user, "What occupation would you like to put on this card?\nNote: This will not grant any access levels other than Maintenance.", "Agent card job assignment", "Civilian")),1,MAX_MESSAGE_LEN)
+ var u = sanitize(copytext(input(user, "What occupation would you like to put on this card?\nNote: This will not grant any access levels other than Maintenance.", "Agent card job assignment", "Civilian"),1,MAX_MESSAGE_LEN))
if(!u)
alert("Invalid assignment.")
src.registered_name = ""
diff --git a/code/game/objects/items/weapons/implants/implantcase.dm b/code/game/objects/items/weapons/implants/implantcase.dm
index f1db8bf0097..15713658712 100644
--- a/code/game/objects/items/weapons/implants/implantcase.dm
+++ b/code/game/objects/items/weapons/implants/implantcase.dm
@@ -29,7 +29,7 @@
return
if((!in_range(src, usr) && src.loc != user))
return
- t = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
+ t = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
if(t)
src.name = text("Glass Case- '[]'", t)
else
diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm
index 1b0825f4f84..5708ed9c604 100644
--- a/code/game/objects/structures/morgue.dm
+++ b/code/game/objects/structures/morgue.dm
@@ -111,7 +111,7 @@
return
if ((!in_range(src, usr) && src.loc != user))
return
- t = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
+ t = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
if (t)
src.name = text("Morgue- '[]'", t)
src.overlays += image(src.icon, "morgue_label")
@@ -285,7 +285,7 @@
return
if ((!in_range(src, usr) > 1 && src.loc != user))
return
- t = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
+ t = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
if (t)
src.name = text("Crematorium- '[]'", t)
else
diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm
index 57216de9efd..9f938b58a3d 100644
--- a/code/game/supplyshuttle.dm
+++ b/code/game/supplyshuttle.dm
@@ -373,7 +373,7 @@ var/list/mechtoys = list(
if(!istype(P)) return
var/timeout = world.time + 600
- var/reason = copytext(sanitize(input(usr,"Reason:","Why do you require this item?","") as null|text),1,MAX_MESSAGE_LEN)
+ var/reason = sanitize(copytext(input(usr,"Reason:","Why do you require this item?","") as null|text,1,MAX_MESSAGE_LEN))
if(world.time > timeout) return
if(!reason) return
@@ -578,7 +578,7 @@ var/list/mechtoys = list(
if(!istype(P)) return
var/timeout = world.time + 600
- var/reason = copytext(sanitize(input(usr,"Reason:","Why do you require this item?","") as null|text),1,MAX_MESSAGE_LEN)
+ var/reason = sanitize(copytext(input(usr,"Reason:","Why do you require this item?","") as null|text,1,MAX_MESSAGE_LEN))
if(world.time > timeout) return
if(!reason) return
diff --git a/code/game/verbs/ooc.dm b/code/game/verbs/ooc.dm
index 61ec3c862ee..093b139f677 100644
--- a/code/game/verbs/ooc.dm
+++ b/code/game/verbs/ooc.dm
@@ -10,7 +10,7 @@ var/global/normal_ooc_colour = "#002eb8"
src << "Guests may not use OOC."
return
- msg = trim(copytext(sanitize(msg), 1, MAX_MESSAGE_LEN))
+ msg = trim(sanitize(copytext(msg, 1, MAX_MESSAGE_LEN)))
if(!msg) return
if(!(prefs.toggles & CHAT_OOC))
@@ -92,7 +92,7 @@ var/global/normal_ooc_colour = "#002eb8"
src << "Guests may not use OOC."
return
- msg = trim(copytext(sanitize(msg), 1, MAX_MESSAGE_LEN))
+ msg = trim(sanitize(copytext(msg, 1, MAX_MESSAGE_LEN)))
if(!msg) return
if(!(prefs.toggles & CHAT_LOOC))
diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm
index 3dcd7895dbb..07af614f498 100644
--- a/code/modules/admin/topic.dm
+++ b/code/modules/admin/topic.dm
@@ -2242,7 +2242,7 @@
if(!ticker)
alert("The game hasn't started yet!")
return
- var/objective = copytext(sanitize(input("Enter an objective")),1,MAX_MESSAGE_LEN)
+ var/objective = sanitize(copytext(input("Enter an objective"),1,MAX_MESSAGE_LEN))
if(!objective)
return
feedback_inc("admin_secrets_fun_used",1)
diff --git a/code/modules/admin/verbs/adminsay.dm b/code/modules/admin/verbs/adminsay.dm
index ceefd17c3a6..cf3e5d951f9 100644
--- a/code/modules/admin/verbs/adminsay.dm
+++ b/code/modules/admin/verbs/adminsay.dm
@@ -5,7 +5,7 @@
if(!check_rights(R_ADMIN)) return
- msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN)
+ msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
if(!msg) return
log_admin("[key_name(src)] : [msg]")
@@ -26,7 +26,7 @@
if(!check_rights(R_ADMIN|R_MOD)) return
- msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN)
+ msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
log_admin("MOD: [key_name(src)] : [msg]")
if (!msg)
diff --git a/code/modules/admin/verbs/deadsay.dm b/code/modules/admin/verbs/deadsay.dm
index b4253848893..1fe7e90105f 100644
--- a/code/modules/admin/verbs/deadsay.dm
+++ b/code/modules/admin/verbs/deadsay.dm
@@ -28,7 +28,7 @@
if (src.holder.rights & R_ADMIN)
stafftype = "ADMIN"
- msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN)
+ msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
log_admin("[key_name(src)] : [msg]")
if (!msg)
diff --git a/code/modules/admin/verbs/honksquad.dm b/code/modules/admin/verbs/honksquad.dm
index beb903bf5b0..a56d6cd091f 100644
--- a/code/modules/admin/verbs/honksquad.dm
+++ b/code/modules/admin/verbs/honksquad.dm
@@ -19,7 +19,7 @@ var/global/sent_honksquad = 0
var/input = null
while(!input)
- input = copytext(sanitize(input(src, "Please specify which mission the HONKsquad shall undertake.", "Specify Mission", "")),1,MAX_MESSAGE_LEN)
+ input = sanitize(copytext(input(src, "Please specify which mission the HONKsquad shall undertake.", "Specify Mission", ""),1,MAX_MESSAGE_LEN))
if(!input)
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
return
diff --git a/code/modules/admin/verbs/pray.dm b/code/modules/admin/verbs/pray.dm
index caab5c8b258..4ca805ac35c 100644
--- a/code/modules/admin/verbs/pray.dm
+++ b/code/modules/admin/verbs/pray.dm
@@ -2,7 +2,7 @@
set category = "IC"
set name = "Pray"
- msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN)
+ msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
if(!msg) return
if(usr.client)
@@ -39,7 +39,7 @@
//log_admin("HELP: [key_name(src)]: [msg]")
/proc/Centcomm_announce(var/text , var/mob/Sender)
- var/msg = copytext(sanitize(text), 1, MAX_MESSAGE_LEN)
+ var/msg = sanitize(copytext(text, 1, MAX_MESSAGE_LEN))
msg = "\blue CENTCOMM:[key_name(Sender, 1)] (PP) (VV) (SM) (JMP) (CA) (BSA) (RPLY): [msg]"
var/list/eventholders = list()
@@ -61,7 +61,7 @@
return
/proc/Syndicate_announce(var/text , var/mob/Sender)
- var/msg = copytext(sanitize(text), 1, MAX_MESSAGE_LEN)
+ var/msg = sanitize(copytext(text, 1, MAX_MESSAGE_LEN))
msg = "\blue SYNDICATE: [key_name(Sender, 1)] (PP) (VV) (SM) (JMP) (CA) (BSA) (REPLY): [msg]"
var/list/eventholders = list()
@@ -83,7 +83,7 @@
return
/proc/HONK_announce(var/text , var/mob/Sender)
- var/msg = copytext(sanitize(text), 1, MAX_MESSAGE_LEN)
+ var/msg = sanitize(copytext(text, 1, MAX_MESSAGE_LEN))
msg = "\blue HONK:[key_name(Sender, 1)] (PP) (VV) (SM) (JMP) (CA) (BSA) (RPLY): [msg]"
var/list/eventholders = list()
diff --git a/code/modules/admin/verbs/striketeam.dm b/code/modules/admin/verbs/striketeam.dm
index b4821d699ad..3218678712c 100644
--- a/code/modules/admin/verbs/striketeam.dm
+++ b/code/modules/admin/verbs/striketeam.dm
@@ -19,7 +19,7 @@ var/global/sent_strike_team = 0
var/input = null
while(!input)
- input = copytext(sanitize(input(src, "Please specify which mission the death commando squad shall undertake.", "Specify Mission", "")),1,MAX_MESSAGE_LEN)
+ input = sanitize(copytext(input(src, "Please specify which mission the death commando squad shall undertake.", "Specify Mission", ""),1,MAX_MESSAGE_LEN))
if(!input)
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
return
diff --git a/code/modules/admin/verbs/striketeam_syndicate.dm b/code/modules/admin/verbs/striketeam_syndicate.dm
index c43e93dde6c..755bc91817e 100644
--- a/code/modules/admin/verbs/striketeam_syndicate.dm
+++ b/code/modules/admin/verbs/striketeam_syndicate.dm
@@ -24,7 +24,7 @@ var/global/sent_syndicate_strike_team = 0
var/input = null
while(!input)
- input = copytext(sanitize(input(src, "Please specify which mission the syndicate strike team shall undertake.", "Specify Mission", "")),1,MAX_MESSAGE_LEN)
+ input = sanitize(copytext(input(src, "Please specify which mission the syndicate strike team shall undertake.", "Specify Mission", ""),1,MAX_MESSAGE_LEN))
if(!input)
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
return
diff --git a/code/modules/computer3/computers/card.dm b/code/modules/computer3/computers/card.dm
index 7c928d2ebec..5c4a92f3227 100644
--- a/code/modules/computer3/computers/card.dm
+++ b/code/modules/computer3/computers/card.dm
@@ -304,7 +304,7 @@
if(auth)
var/t1 = href_list["assign"]
if(t1 == "Custom")
- var/temp_t = copytext(sanitize(input("Enter a custom job assignment.","Assignment")),1,MAX_MESSAGE_LEN)
+ var/temp_t = sanitize(copytext(input("Enter a custom job assignment.","Assignment"),1,MAX_MESSAGE_LEN))
if(temp_t)
t1 = temp_t
set_default_access(t1)
diff --git a/code/modules/computer3/computers/medical.dm b/code/modules/computer3/computers/medical.dm
index 7fc5da12326..af2a3340ae3 100644
--- a/code/modules/computer3/computers/medical.dm
+++ b/code/modules/computer3/computers/medical.dm
@@ -263,7 +263,7 @@
switch(href_list["field"])
if("fingerprint")
if (istype(src.active1, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please input fingerprint hash:", "Med. records", src.active1.fields["fingerprint"], null) as text),1,MAX_MESSAGE_LEN)
+ var/t1 = trim(sanitize(copytext(input("Please input fingerprint hash:", "Med. records", src.active1.fields["fingerprint"], null) as text,1,MAX_MESSAGE_LEN)))
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
return
src.active1.fields["fingerprint"] = t1
@@ -281,55 +281,55 @@
src.active1.fields["age"] = t1
if("mi_dis")
if (istype(src.active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please input minor disabilities list:", "Med. records", src.active2.fields["mi_dis"], null) as text),1,MAX_MESSAGE_LEN)
+ var/t1 = sanitize(copytext(input("Please input minor disabilities list:", "Med. records", src.active2.fields["mi_dis"], null) as text,1,MAX_MESSAGE_LEN))
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["mi_dis"] = t1
if("mi_dis_d")
if (istype(src.active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please summarize minor dis.:", "Med. records", src.active2.fields["mi_dis_d"], null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = sanitize(copytext(input("Please summarize minor dis.:", "Med. records", src.active2.fields["mi_dis_d"], null) as message,1,MAX_MESSAGE_LEN))
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["mi_dis_d"] = t1
if("ma_dis")
if (istype(src.active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please input major diabilities list:", "Med. records", src.active2.fields["ma_dis"], null) as text),1,MAX_MESSAGE_LEN)
+ var/t1 = sanitize(copytext(input("Please input major diabilities list:", "Med. records", src.active2.fields["ma_dis"], null) as text,1,MAX_MESSAGE_LEN))
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["ma_dis"] = t1
if("ma_dis_d")
if (istype(src.active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please summarize major dis.:", "Med. records", src.active2.fields["ma_dis_d"], null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = sanitize(copytext(input("Please summarize major dis.:", "Med. records", src.active2.fields["ma_dis_d"], null) as message,1,MAX_MESSAGE_LEN))
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["ma_dis_d"] = t1
if("alg")
if (istype(src.active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please state allergies:", "Med. records", src.active2.fields["alg"], null) as text),1,MAX_MESSAGE_LEN)
+ var/t1 = sanitize(copytext(input("Please state allergies:", "Med. records", src.active2.fields["alg"], null) as text,1,MAX_MESSAGE_LEN))
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["alg"] = t1
if("alg_d")
if (istype(src.active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please summarize allergies:", "Med. records", src.active2.fields["alg_d"], null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = sanitize(copytext(input("Please summarize allergies:", "Med. records", src.active2.fields["alg_d"], null) as message,1,MAX_MESSAGE_LEN))
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["alg_d"] = t1
if("cdi")
if (istype(src.active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please state diseases:", "Med. records", src.active2.fields["cdi"], null) as text),1,MAX_MESSAGE_LEN)
+ var/t1 = sanitize(copytext(input("Please state diseases:", "Med. records", src.active2.fields["cdi"], null) as text,1,MAX_MESSAGE_LEN))
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["cdi"] = t1
if("cdi_d")
if (istype(src.active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please summarize diseases:", "Med. records", src.active2.fields["cdi_d"], null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = sanitize(copytext(input("Please summarize diseases:", "Med. records", src.active2.fields["cdi_d"], null) as message,1,MAX_MESSAGE_LEN))
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["cdi_d"] = t1
if("notes")
if (istype(src.active2, /datum/data/record))
- var/t1 = copytext(html_encode(input("Please summarize notes:", "Med. records", html_decode(src.active2.fields["notes"]), null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = html_encode(trim(copytext(input("Please summarize notes:", "Med. records", html_decode(src.active2.fields["notes"]), null) as message,1,MAX_MESSAGE_LEN)))
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["notes"] = t1
@@ -344,21 +344,21 @@
src.temp = text("Blood Type:
\n\tA- A+
\n\tB- B+
\n\tAB- AB+
\n\tO- O+
", src, src, src, src, src, src, src, src)
if("b_dna")
if (istype(src.active1, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please input DNA hash:", "Med. records", src.active1.fields["dna"], null) as text),1,MAX_MESSAGE_LEN)
+ var/t1 = sanitize(copytext(input("Please input DNA hash:", "Med. records", src.active1.fields["dna"], null) as text,1,MAX_MESSAGE_LEN))
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
return
src.active1.fields["dna"] = t1
if("vir_name")
var/datum/data/record/v = locate(href_list["edit_vir"])
if (v)
- var/t1 = copytext(sanitize(input("Please input pathogen name:", "VirusDB", v.fields["name"], null) as text),1,MAX_MESSAGE_LEN)
+ var/t1 = sanitize(copytext(input("Please input pathogen name:", "VirusDB", v.fields["name"], null) as text,1,MAX_MESSAGE_LEN))
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
return
v.fields["name"] = t1
if("vir_desc")
var/datum/data/record/v = locate(href_list["edit_vir"])
if (v)
- var/t1 = copytext(sanitize(input("Please input information about pathogen:", "VirusDB", v.fields["description"], null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = sanitize(copytext(input("Please input information about pathogen:", "VirusDB", v.fields["description"], null) as message,1,MAX_MESSAGE_LEN))
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
return
v.fields["description"] = t1
@@ -461,7 +461,7 @@
if (!( istype(src.active2, /datum/data/record) ))
return
var/a2 = src.active2
- var/t1 = copytext(sanitize(input("Add Comment:", "Med. records", null, null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = sanitize(copytext(input("Add Comment:", "Med. records", null, null) as message,1,MAX_MESSAGE_LEN))
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
var/counter = 1
diff --git a/code/modules/computer3/computers/message.dm b/code/modules/computer3/computers/message.dm
index 3bbb580f5e9..3eab3f59269 100644
--- a/code/modules/computer3/computers/message.dm
+++ b/code/modules/computer3/computers/message.dm
@@ -383,7 +383,7 @@
//Enter message
if("Message")
custommessage = input(usr, "Please enter your message.") as text|null
- custommessage = copytext(sanitize(custommessage), 1, MAX_MESSAGE_LEN)
+ custommessage = sanitize(copytext(custommessage), 1, MAX_MESSAGE_LEN)
//Send message
if("Send")
diff --git a/code/modules/computer3/computers/prisoner.dm b/code/modules/computer3/computers/prisoner.dm
index 11aa5ebd6e9..4bb238852fc 100644
--- a/code/modules/computer3/computers/prisoner.dm
+++ b/code/modules/computer3/computers/prisoner.dm
@@ -90,7 +90,7 @@
screen = !screen
else if(href_list["warn"])
- var/warning = trim(copytext(sanitize(input(usr,"Message:","Enter your message here!","")),1,MAX_MESSAGE_LEN))
+ var/warning = trim(sanitize(copytext(input(usr,"Message:","Enter your message here!",""),1,MAX_MESSAGE_LEN)))
if(!warning) return
var/obj/item/weapon/implant/I = locate(href_list["warn"])
if( istype(I) && I.imp_in)
diff --git a/code/modules/computer3/computers/security.dm b/code/modules/computer3/computers/security.dm
index 477f7c7f972..cccfaca2d6e 100644
--- a/code/modules/computer3/computers/security.dm
+++ b/code/modules/computer3/computers/security.dm
@@ -404,7 +404,7 @@ What a mess.*/
if (!( istype(active2, /datum/data/record) ))
return
var/a2 = active2
- var/t1 = copytext(sanitize(input("Add Comment:", "Secure. records", null, null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = sanitize(copytext(input("Add Comment:", "Secure. records", null, null) as message,1,MAX_MESSAGE_LEN))
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
var/counter = 1
@@ -473,13 +473,13 @@ What a mess.*/
active1.fields["name"] = t1
if("id")
if (istype(active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please input id:", "Secure. records", active1.fields["id"], null) as text),1,MAX_MESSAGE_LEN)
+ var/t1 = sanitize(copytext(input("Please input id:", "Secure. records", active1.fields["id"], null) as text,1,MAX_MESSAGE_LEN))
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active1 != a1))
return
active1.fields["id"] = t1
if("fingerprint")
if (istype(active1, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please input fingerprint hash:", "Secure. records", active1.fields["fingerprint"], null) as text),1,MAX_MESSAGE_LEN)
+ var/t1 = sanitize(copytext(input("Please input fingerprint hash:", "Secure. records", active1.fields["fingerprint"], null) as text,1,MAX_MESSAGE_LEN))
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active1 != a1))
return
active1.fields["fingerprint"] = t1
@@ -497,31 +497,31 @@ What a mess.*/
active1.fields["age"] = t1
if("mi_crim")
if (istype(active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please input minor disabilities list:", "Secure. records", active2.fields["mi_crim"], null) as text),1,MAX_MESSAGE_LEN)
+ var/t1 = sanitize(copytext(input("Please input minor disabilities list:", "Secure. records", active2.fields["mi_crim"], null) as text,1,MAX_MESSAGE_LEN))
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
active2.fields["mi_crim"] = t1
if("mi_crim_d")
if (istype(active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please summarize minor dis.:", "Secure. records", active2.fields["mi_crim_d"], null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = sanitize(copytext(input("Please summarize minor dis.:", "Secure. records", active2.fields["mi_crim_d"], null) as message,1,MAX_MESSAGE_LEN))
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
active2.fields["mi_crim_d"] = t1
if("ma_crim")
if (istype(active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please input major diabilities list:", "Secure. records", active2.fields["ma_crim"], null) as text),1,MAX_MESSAGE_LEN)
+ var/t1 = sanitize(copytext(input("Please input major diabilities list:", "Secure. records", active2.fields["ma_crim"], null) as text,1,MAX_MESSAGE_LEN))
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
active2.fields["ma_crim"] = t1
if("ma_crim_d")
if (istype(active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please summarize major dis.:", "Secure. records", active2.fields["ma_crim_d"], null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = sanitize(copytext(input("Please summarize major dis.:", "Secure. records", active2.fields["ma_crim_d"], null) as message,1,MAX_MESSAGE_LEN))
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
active2.fields["ma_crim_d"] = t1
if("notes")
if (istype(active2, /datum/data/record))
- var/t1 = copytext(html_encode(input("Please summarize notes:", "Secure. records", html_decode(active2.fields["notes"]), null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = trim(sanitize(copytext(input("Please summarize minor dis.:", "Secure. records", active2.fields["mi_crim_d"], null) as message,1,MAX_MESSAGE_LEN)))
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
active2.fields["notes"] = t1
@@ -548,7 +548,7 @@ What a mess.*/
alert(usr, "You do not have the required rank to do this!")
if("species")
if (istype(active1, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please enter race:", "General records", active1.fields["species"], null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = sanitize(copytext(input("Please enter race:", "General records", active1.fields["species"], null) as message,1,MAX_MESSAGE_LEN))
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active1 != a1))
return
active1.fields["species"] = t1
diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm
index 66c19bfcda0..74436079af6 100644
--- a/code/modules/library/lib_machines.dm
+++ b/code/modules/library/lib_machines.dm
@@ -302,9 +302,9 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
if(checkoutperiod < 1)
checkoutperiod = 1
if(href_list["editbook"])
- buffer_book = copytext(sanitize(input("Enter the book's title:") as text|null),1,MAX_MESSAGE_LEN)
+ buffer_book = sanitize(copytext(input("Enter the book's title:") as text|null,1,MAX_MESSAGE_LEN))
if(href_list["editmob"])
- buffer_mob = copytext(sanitize(input("Enter the recipient's name:") as text|null),1,MAX_NAME_LEN)
+ buffer_mob = sanitize(copytext(input("Enter the recipient's name:") as text|null,1,MAX_NAME_LEN))
if(href_list["checkout"])
var/datum/borrowbook/b = new /datum/borrowbook
b.bookname = sanitize(buffer_book)
@@ -319,7 +319,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
var/obj/item/weapon/book/b = locate(href_list["delbook"])
inventory.Remove(b)
if(href_list["setauthor"])
- var/newauthor = copytext(sanitize(input("Enter the author's name: ") as text|null),1,MAX_MESSAGE_LEN)
+ var/newauthor = sanitize(copytext(input("Enter the author's name: ") as text|null,1,MAX_MESSAGE_LEN))
if(newauthor)
scanner.cache.author = newauthor
if(href_list["setcategory"])
diff --git a/code/modules/mob/emote.dm b/code/modules/mob/emote.dm
index 07e8d5c6dee..32af0998702 100644
--- a/code/modules/mob/emote.dm
+++ b/code/modules/mob/emote.dm
@@ -10,7 +10,7 @@
var/input
if(!message)
- input = copytext(sanitize(input(src,"Choose an emote to display.") as text|null),1,MAX_MESSAGE_LEN)
+ input = sanitize(copytext(input(src,"Choose an emote to display.") as text|null,1,MAX_MESSAGE_LEN))
else
input = message
if(input)
@@ -85,7 +85,7 @@
var/input
if(!message)
- input = copytext(sanitize(input(src, "Choose an emote to display.") as text|null), 1, MAX_MESSAGE_LEN)
+ input = sanitize(copytext(input(src, "Choose an emote to display.") as text|null, 1, MAX_MESSAGE_LEN))
else
input = message
diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm
index 28afe49ab45..40dd8959564 100644
--- a/code/modules/mob/living/carbon/human/emote.dm
+++ b/code/modules/mob/living/carbon/human/emote.dm
@@ -113,7 +113,7 @@
m_type = 1
if ("custom")
- var/input = copytext(sanitize(input("Choose an emote to display.") as text|null),1,MAX_MESSAGE_LEN)
+ var/input = sanitize(copytext(input("Choose an emote to display.") as text|null,1,MAX_MESSAGE_LEN))
if (!input)
return
var/input2 = input("Is this a visible or hearable emote?") in list("Visible","Hearable")
@@ -740,11 +740,11 @@
set desc = "Sets a description which will be shown when someone examines you."
set category = "IC"
- pose = copytext(sanitize(input(usr, "This is [src]. \He is...", "Pose", null) as text), 1, MAX_MESSAGE_LEN)
+ pose = sanitize(copytext(input(usr, "This is [src]. \He is...", "Pose", null) as text, 1, MAX_MESSAGE_LEN))
/mob/living/carbon/human/verb/set_flavor()
set name = "Set Flavour Text"
set desc = "Sets an extended description of your character's features."
set category = "IC"
- flavor_text = copytext(sanitize(input(usr, "Please enter your new flavour text.", "Flavour text", null) as text), 1)
+ flavor_text = sanitize(copytext(input(usr, "Please enter your new flavour text.", "Flavour text", null) as text, 1))
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index ff64560fbbe..1435949c6a6 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -853,7 +853,7 @@
for (var/datum/data/record/R in data_core.security)
if (R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"security"))
- var/t1 = copytext(sanitize(input("Add Comment:", "Sec. records", null, null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = sanitize(copytext(input("Add Comment:", "Sec. records", null, null) as message,1,MAX_MESSAGE_LEN))
if ( !(t1) || usr.stat || usr.restrained() || !(hasHUD(usr,"security")) )
return
var/counter = 1
@@ -985,7 +985,7 @@
for (var/datum/data/record/R in data_core.medical)
if (R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"medical"))
- var/t1 = copytext(sanitize(input("Add Comment:", "Med. records", null, null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = sanitize(copytext(input("Add Comment:", "Med. records", null, null) as message,1,MAX_MESSAGE_LEN))
if ( !(t1) || usr.stat || usr.restrained() || !(hasHUD(usr,"medical")) )
return
var/counter = 1
diff --git a/code/modules/mob/living/carbon/metroid/metroid.dm b/code/modules/mob/living/carbon/metroid/metroid.dm
index dbdeb728fa6..5ed4f781cae 100644
--- a/code/modules/mob/living/carbon/metroid/metroid.dm
+++ b/code/modules/mob/living/carbon/metroid/metroid.dm
@@ -803,7 +803,7 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75
pet.colour = "[M.colour]"
user <<"You feed the slime the potion, removing it's powers and calming it."
del(M)
- var/newname = copytext(sanitize(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text),1,MAX_NAME_LEN)
+ var/newname = sanitize(copytext(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text,1,MAX_NAME_LEN))
if (!newname)
newname = "pet slime"
@@ -834,7 +834,7 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75
pet.colour = "[M.colour]"
user <<"You feed the slime the potion, removing it's powers and calming it."
del(M)
- var/newname = copytext(sanitize(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text),1,MAX_NAME_LEN)
+ var/newname = sanitize(copytext(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text,1,MAX_NAME_LEN))
if (!newname)
newname = "pet slime"
diff --git a/code/modules/mob/living/silicon/pai/recruit.dm b/code/modules/mob/living/silicon/pai/recruit.dm
index 9ffc8e0a003..1b4b2fb1d40 100644
--- a/code/modules/mob/living/silicon/pai/recruit.dm
+++ b/code/modules/mob/living/silicon/pai/recruit.dm
@@ -64,32 +64,32 @@ var/datum/paiController/paiController // Global handler for pAI candidates
if("name")
t = input("Enter a name for your pAI", "pAI Name", candidate.name) as text
if(t)
- candidate.name = copytext(sanitize(t),1,MAX_NAME_LEN)
+ candidate.name = sanitize(copytext(t,1,MAX_NAME_LEN))
if("desc")
t = input("Enter a description for your pAI", "pAI Description", candidate.description) as message
if(t)
- candidate.description = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
+ candidate.description = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
if("role")
t = input("Enter a role for your pAI", "pAI Role", candidate.role) as text
if(t)
- candidate.role = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
+ candidate.role = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
if("ooc")
t = input("Enter any OOC comments", "pAI OOC Comments", candidate.comments) as message
if(t)
- candidate.comments = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
+ candidate.comments = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
if("save")
candidate.savefile_save(usr)
if("load")
candidate.savefile_load(usr)
//In case people have saved unsanitized stuff.
if(candidate.name)
- candidate.name = copytext(sanitize(candidate.name),1,MAX_NAME_LEN)
+ candidate.name = sanitize(copytext(candidate.name,1,MAX_NAME_LEN))
if(candidate.description)
- candidate.description = copytext(sanitize(candidate.description),1,MAX_MESSAGE_LEN)
+ candidate.description = sanitize(copytext(candidate.description,1,MAX_MESSAGE_LEN))
if(candidate.role)
- candidate.role = copytext(sanitize(candidate.role),1,MAX_MESSAGE_LEN)
+ candidate.role = sanitize(copytext(candidate.role,1,MAX_MESSAGE_LEN))
if(candidate.comments)
- candidate.comments = copytext(sanitize(candidate.comments),1,MAX_MESSAGE_LEN)
+ candidate.comments = sanitize(copytext(candidate.comments,1,MAX_MESSAGE_LEN))
if("submit")
if(candidate)
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index ae42fbc4697..d446be62095 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -361,7 +361,7 @@
spawn(0)
var/newname
- newname = copytext(sanitize(input(src,"You are a robot. Enter a name, or leave blank for the default name.", "Name change","") as text),1,MAX_NAME_LEN)
+ newname = sanitize(copytext(input(src,"You are a robot. Enter a name, or leave blank for the default name.", "Name change","") as text,1,MAX_NAME_LEN))
if (newname != "")
notify_ai(3, name, newname)
custom_name = newname
diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm
index 86da14df0e7..1eb36aa0c19 100644
--- a/code/modules/mob/living/silicon/silicon.dm
+++ b/code/modules/mob/living/silicon/silicon.dm
@@ -282,14 +282,14 @@
set desc = "Sets a description which will be shown when someone examines you."
set category = "IC"
- pose = copytext(sanitize(input(usr, "This is [src]. It is...", "Pose", null) as text), 1, MAX_MESSAGE_LEN)
+ pose = sanitize(copytext(input(usr, "This is [src]. It is...", "Pose", null) as text, 1, MAX_MESSAGE_LEN))
/mob/living/silicon/verb/set_flavor()
set name = "Set Flavour Text"
set desc = "Sets an extended description of your character's features."
set category = "IC"
- flavor_text = copytext(sanitize(input(usr, "Please enter your new flavour text.", "Flavour text", null) as text), 1)
+ flavor_text = sanitize(copytext(input(usr, "Please enter your new flavour text.", "Flavour text", null) as text, 1))
/mob/living/silicon/binarycheck()
return 1
diff --git a/code/modules/mob/living/simple_animal/borer.dm b/code/modules/mob/living/simple_animal/borer.dm
index 50334dbdf27..f8dd9e5c6fe 100644
--- a/code/modules/mob/living/simple_animal/borer.dm
+++ b/code/modules/mob/living/simple_animal/borer.dm
@@ -12,7 +12,7 @@
return
if(istype(src.loc,/mob/living/simple_animal/borer))
- message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
+ message = trim(sanitize(copytext(message, 1, MAX_MESSAGE_LEN)))
if (!message)
return
log_say("[key_name(src)] : [message]")
diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm
index d3abbfc1776..4c5a6d09372 100644
--- a/code/modules/mob/mob_helpers.dm
+++ b/code/modules/mob/mob_helpers.dm
@@ -278,7 +278,7 @@ proc/slur(phrase)
n_letter = text("[n_letter]-[n_letter]")
t = text("[t][n_letter]")//since the above is ran through for each letter, the text just adds up back to the original word.
p++//for each letter p is increased to find where the next letter will be.
- return copytext(sanitize(t),1,MAX_MESSAGE_LEN)
+ return sanitize(copytext(t,1,MAX_MESSAGE_LEN))
proc/Gibberish(t, p)//t is the inputted message, and any value higher than 70 for p will cause letters to be replaced instead of added
@@ -325,7 +325,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
n_letter = text("[n_letter]")
t = text("[t][n_letter]")
p=p+n_mod
- return copytext(sanitize(t),1,MAX_MESSAGE_LEN)
+ return sanitize(copytext(t,1,MAX_MESSAGE_LEN))
/proc/shake_camera(mob/M, duration, strength=1)
diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm
index 7beff751760..d1de4684eb4 100644
--- a/code/modules/paperwork/faxmachine.dm
+++ b/code/modules/paperwork/faxmachine.dm
@@ -133,7 +133,7 @@ var/list/alldepartments = list()
if(href_list["rename"])
if(copyitem)
- var/n_name = copytext(sanitize(input(usr, "What would you like to label the fax?", "Fax Labelling", copyitem.name) as text), 1, MAX_MESSAGE_LEN)
+ var/n_name = sanitize(copytext(input(usr, "What would you like to label the fax?", "Fax Labelling", copyitem.name) as text, 1, MAX_MESSAGE_LEN))
if((copyitem && copyitem.loc == src && usr.stat == 0))
if (istype(copyitem, /obj/item/weapon/paper))
copyitem.name = "[(n_name ? text("[n_name]") : initial(copyitem.name))]"
diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm
index 828c9f90d29..c8b674fe5f3 100644
--- a/code/modules/paperwork/folders.dm
+++ b/code/modules/paperwork/folders.dm
@@ -37,7 +37,7 @@
user << "You put the [W] into \the [src]."
update_icon()
else if(istype(W, /obj/item/weapon/pen))
- var/n_name = copytext(sanitize(input(usr, "What would you like to label the folder?", "Folder Labelling", null) as text), 1, MAX_NAME_LEN)
+ var/n_name = sanitize(copytext(input(usr, "What would you like to label the folder?", "Folder Labelling", null) as text, 1, MAX_NAME_LEN))
if((loc == usr && usr.stat == 0))
name = "folder[(n_name ? text("- '[n_name]'") : null)]"
return
diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm
index fce6c2acda6..e1727a18ad7 100644
--- a/code/modules/paperwork/paper.dm
+++ b/code/modules/paperwork/paper.dm
@@ -76,7 +76,7 @@
if((M_CLUMSY in usr.mutations) && prob(50))
usr << "You cut yourself on the paper."
return
- var/n_name = copytext(sanitize(input(usr, "What would you like to label the paper?", "Paper Labelling", name) as text), 1, MAX_MESSAGE_LEN)
+ var/n_name = sanitize(copytext(input(usr, "What would you like to label the paper?", "Paper Labelling", name) as text, 1, MAX_MESSAGE_LEN))
if((loc == usr && usr.stat == 0))
name = "[(n_name ? text("[n_name]") : initial(name))]"
if(name != "paper")
@@ -185,7 +185,7 @@
/obj/item/weapon/paper/proc/parsepencode(var/t, var/obj/item/weapon/pen/P, mob/user as mob, var/iscrayon = 0)
-// t = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
+// t = sanitize(copytext(t),1,MAX_MESSAGE_LEN)
t = replacetext(t, "\[center\]", "")
t = replacetext(t, "\[/center\]", "")
diff --git a/code/modules/paperwork/paper_bundle.dm b/code/modules/paperwork/paper_bundle.dm
index f821871069c..a3add5a8aa7 100644
--- a/code/modules/paperwork/paper_bundle.dm
+++ b/code/modules/paperwork/paper_bundle.dm
@@ -189,7 +189,7 @@
set category = "Object"
set src in usr
- var/n_name = copytext(sanitize(input(usr, "What would you like to label the bundle?", "Bundle Labelling", name) as text), 1, MAX_MESSAGE_LEN)
+ var/n_name = sanitize(copytext(input(usr, "What would you like to label the bundle?", "Bundle Labelling", name) as text, 1, MAX_MESSAGE_LEN))
if((loc == usr && usr.stat == 0))
name = "[(n_name ? text("[n_name]") : "paper bundle")]"
add_fingerprint(usr)
diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm
index 479d2510605..111acf13f5f 100644
--- a/code/modules/paperwork/photography.dm
+++ b/code/modules/paperwork/photography.dm
@@ -90,7 +90,7 @@
set category = "Object"
set src in usr
- var/n_name = copytext(sanitize(input(usr, "What would you like to label the photo?", "Photo Labelling", name) as text), 1, MAX_MESSAGE_LEN)
+ var/n_name = sanitize(copytext(input(usr, "What would you like to label the photo?", "Photo Labelling", name) as text, 1, MAX_MESSAGE_LEN))
//loc.loc check is for making possible renaming photos in clipboards
if(( (loc == usr || (loc.loc && loc.loc == usr)) && usr.stat == 0))
name = "[(n_name ? text("[n_name]") : "photo")]"
diff --git a/code/modules/reagents/reagent_containers/food/snacks.dm b/code/modules/reagents/reagent_containers/food/snacks.dm
index 93841370d75..ceedd371255 100644
--- a/code/modules/reagents/reagent_containers/food/snacks.dm
+++ b/code/modules/reagents/reagent_containers/food/snacks.dm
@@ -136,7 +136,7 @@
/obj/item/weapon/reagent_containers/food/snacks/attackby(obj/item/weapon/W, mob/user)
if(istype(W,/obj/item/weapon/pen))
- var/n_name = copytext(sanitize(input(usr, "What would you like to name this dish?", "Food Renaming", null) as text), 1, MAX_NAME_LEN)
+ var/n_name = sanitize(copytext(input(usr, "What would you like to name this dish?", "Food Renaming", null) as text, 1, MAX_NAME_LEN))
if((loc == usr && usr.stat == 0))
name = "[n_name]"
return
diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm
index 17f62fc9c67..7f3689cc99b 100755
--- a/code/modules/recycling/sortingmachinery.dm
+++ b/code/modules/recycling/sortingmachinery.dm
@@ -29,7 +29,7 @@
playsound(src.loc, 'sound/machines/twobeep.ogg', 100, 1)
else if(istype(W, /obj/item/weapon/pen))
- var/str = copytext(sanitize(input(usr,"Label text?","Set label","")),1,MAX_NAME_LEN)
+ var/str = sanitize(copytext(input(usr,"Label text?","Set label",""),1,MAX_NAME_LEN))
if(!str || !length(str))
usr << "\red Invalid text."
return
@@ -69,7 +69,7 @@
playsound(src.loc, 'sound/machines/twobeep.ogg', 100, 1)
else if(istype(W, /obj/item/weapon/pen))
- var/str = copytext(sanitize(input(usr,"Label text?","Set label","")),1,MAX_NAME_LEN)
+ var/str = sanitize(copytext(input(usr,"Label text?","Set label",""),1,MAX_NAME_LEN))
if(!str || !length(str))
usr << "\red Invalid text."
return
diff --git a/code/modules/telesci/gps.dm b/code/modules/telesci/gps.dm
index 25c5bb154e6..c0a3e9fd58f 100644
--- a/code/modules/telesci/gps.dm
+++ b/code/modules/telesci/gps.dm
@@ -61,7 +61,7 @@ var/list/GPS_list = list()
..()
if(href_list["tag"] )
var/a = input("Please enter desired tag.", name, gpstag) as text
- a = uppertext(copytext(sanitize(a), 1, 5))
+ a = uppertext(sanitize(copytext(a, 1, 5)))
if(src.loc == usr)
gpstag = a
name = "global positioning system ([gpstag])"