sanitize() refactor: fourth pass

This commit is contained in:
volas
2015-03-29 13:47:57 +03:00
parent 96dd9df079
commit 2622d2dbfc
25 changed files with 36 additions and 33 deletions
@@ -280,7 +280,7 @@
voice_holder.active = 0
usr << "<font color='blue'>You disable the speech synthesiser.</font>"
if("Set Name")
var/raw_choice = sanitize(input(usr, "Please enter a new name.") as text|null)
var/raw_choice = sanitize(input(usr, "Please enter a new name.") as text|null, MAX_NAME_LEN)
if(!raw_choice)
return 0
voice_holder.voice = raw_choice
+1 -1
View File
@@ -167,7 +167,7 @@
if("change_id")
var/attempt_code = text2num(input("Re-enter the current EFTPOS access code", "Confirm EFTPOS code"))
if(attempt_code == access_code)
eftpos_name = sanitize(input("Enter a new terminal ID for this device", "Enter new EFTPOS ID")) + " EFTPOS scanner"
eftpos_name = sanitize(input("Enter a new terminal ID for this device", "Enter new EFTPOS ID"), MAX_NAME_LEN) + " EFTPOS scanner"
print_reference()
else
usr << "\icon[src]<span class='warning'>Incorrect code entered.</span>"
+1 -2
View File
@@ -73,8 +73,7 @@
host << "<B>You are [host], one of a race of drifting interstellar plantlike creatures that sometimes share their seeds with human traders.</B>"
host << "<B>Too much darkness will send you into shock and starve you, but light will help you heal.</B>"
var/newname = input(host,"Enter a name, or leave blank for the default name.", "Name change","") as text
newname = sanitize(newname)
var/newname = sanitizeSafe(input(host,"Enter a name, or leave blank for the default name.", "Name change","") as text, MAX_NAME_LEN)
if (newname != "")
host.real_name = newname
host.name = host.real_name
+1 -1
View File
@@ -31,7 +31,7 @@
O.loc = src
update_icon()
else if(istype(O, /obj/item/weapon/pen))
var/newname = sanitizeSafe(input("What would you like to title this bookshelf?"), MAX_MESSAGE_LEN)
var/newname = sanitizeSafe(input("What would you like to title this bookshelf?"), MAX_NAME_LEN)
if(!newname)
return
else
+1 -1
View File
@@ -18,7 +18,7 @@
/mob/dead/observer/emote(var/act, var/type, var/message)
message = sanitize(message)
//message = sanitize(message) - already sanitized in verb/me_verb()
if(!message)
return
@@ -3,6 +3,8 @@
if (silent)
return
message = sanitize(message)
if(!(container && istype(container, /obj/item/device/mmi)))
return //No MMI, can't speak, bucko./N
else
@@ -863,11 +863,11 @@
var/list/creatures = list()
for(var/mob/living/carbon/h in world)
creatures += h
var/mob/target = input ("Who do you want to project your mind to ?") as null|anything in creatures
var/mob/target = input("Who do you want to project your mind to ?") as null|anything in creatures
if (isnull(target))
return
var/say = input ("What do you wish to say")
var/say = sanitize(input("What do you wish to say"))
if(mRemotetalk in target.mutations)
target.show_message("\blue You hear [src.real_name]'s voice: [say]")
else
@@ -1368,4 +1368,4 @@
/mob/living/carbon/human/drop_from_inventory(var/obj/item/W, var/atom/Target = null)
if(W in organs)
return
..()
..()
@@ -1,4 +1,7 @@
/mob/living/carbon/slime/say(var/message)
message = sanitize(message)
var/verb = say_quote(message)
if(copytext(message,1,2) == "*")
@@ -55,9 +55,9 @@ var/datum/paiController/paiController // Global handler for pAI candidates
switch(option)
if("name")
t = input("Enter a name for your pAI", "pAI Name", candidate.name) as text
t = sanitizeSafe(input("Enter a name for your pAI", "pAI Name", candidate.name) as text, MAX_NAME_LEN)
if(t)
candidate.name = sanitizeSafe(t, MAX_NAME_LEN)
candidate.name = t
if("desc")
t = input("Enter a description for your pAI", "pAI Description", candidate.description) as message
if(t)
@@ -714,7 +714,7 @@
if(message_mode)
if(message_mode in radiochannels)
if(ears && istype(ears,/obj/item/device/radio))
ears.talk_into(src,message, message_mode, verb, null)
ears.talk_into(src,sanitize(message), message_mode, verb, null)
..(message)
-1
View File
@@ -263,7 +263,6 @@
set name = "Add Note"
set category = "IC"
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
msg = sanitize(msg)
if(mind)
+1 -1
View File
@@ -58,7 +58,7 @@
if(mode)
user << "<span class='notice'>You turn on \the [src].</span>"
//Now let them chose the text.
var/str = copytext(reject_bad_text(input(user,"Label text?","Set label","")),1,MAX_NAME_LEN)
var/str = sanitizeSafe(input(user,"Label text?","Set label",""), MAX_NAME_LEN)
if(!str || !length(str))
user << "<span class='notice'>Invalid text.</span>"
return
+1 -1
View File
@@ -406,7 +406,7 @@
if(type in diseases) // Make sure this is a disease
D = new type(0, null)
var/list/data = list("viruses"=list(D))
var/name = sanitizeSafe(input(usr,"Name:","Name the culture",D.name))
var/name = sanitizeSafe(input(usr,"Name:","Name the culture",D.name), MAX_NAME_LEN)
if(!name || name == " ") name = D.name
B.name = "[name] culture bottle"
B.desc = "A small bottle. Contains [D.agent] culture in synthblood medium."