mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
sanitize() refactor: fourth pass
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user