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

View File

@@ -49,7 +49,7 @@
return
if (!in_range(src, user) && src.loc != user)
return
t = sanitize(t)
t = sanitizeSafe(t, MAX_NAME_LEN)
if (t)
src.name = "body bag - "
src.name += t

View File

@@ -224,13 +224,13 @@
/obj/item/weapon/card/id/syndicate/attack_self(mob/user as mob)
if(!src.registered_name)
//Stop giving the players unsanitized unputs! You are giving ways for players to intentionally crash clients! -Nodrak
var t = sanitizeName(input(user, "What name would you like to put on this card?", "Agent card name", ishuman(user) ? user.real_name : user.name))
var t = sanitizeName(input(user, "What name would you like to put on this card?", "Agent card name", ishuman(user) ? user.real_name : user.name), MAX_NAME_LEN)
if(!t) //Same as mob/new_player/prefrences.dm
alert("Invalid name.")
return
src.registered_name = t
var u = 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", "Agent"))
var u = 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", "Agent"), MAX_LNAME_LEN)
if(!u)
alert("Invalid assignment.")
src.registered_name = ""

View File

@@ -26,7 +26,7 @@
return
if((!in_range(src, usr) && src.loc != user))
return
t = sanitize(t)
t = sanitizeSafe(t, MAX_NAME_LEN)
if(t)
src.name = text("Glass Case - '[]'", t)
else

View File

@@ -83,8 +83,7 @@
if(user.mind)
user.mind.transfer_to(vox)
spawn(1)
var/newname = input(vox,"Enter a name, or leave blank for the default name.", "Name change","") as text
newname = sanitize(newname)
var/newname = sanitizeSafe(input(vox,"Enter a name, or leave blank for the default name.", "Name change","") as text, MAX_NAME_LEN)
if(!newname || newname == "")
var/datum/language/L = all_languages[vox.species.default_language]
newname = L.get_random_name()

View File

@@ -92,7 +92,7 @@
return
if ((!in_range(src, usr) && src.loc != user))
return
t = sanitize(t)
t = sanitizeSafe(t, MAX_NAME_LEN)
if (t)
src.name = text("Morgue- '[]'", t)
else
@@ -258,7 +258,7 @@
return
if ((!in_range(src, usr) > 1 && src.loc != user))
return
t = sanitize(t)
t = sanitizeSafe(t, MAX_NAME_LEN)
if (t)
src.name = text("Crematorium- '[]'", t)
else