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
+1 -1
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
+2 -2
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 = ""
@@ -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