sanitize renaming id cards via computer and agent cards

Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
Cael_Aislinn
2013-01-14 23:44:16 +10:00
parent d532ec9712
commit 20cacd30de
2 changed files with 7 additions and 3 deletions

View File

@@ -132,8 +132,8 @@
/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 = 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)
if(!t || t == "Unknown" || t == "floor" || t == "wall" || t == "r-wall" || t == "") //Same as mob/new_player/prefrences.dm
var t = reject_bad_name(input(user, "What name would you like to put on this card?", "Agent card name", ishuman(user) ? user.real_name : user.name))
if(!t) //Same as mob/new_player/prefrences.dm
alert("Invalid name.")
return
src.registered_name = t