[s] Sanitizes modular console ID edits (#56657)

Co-authored-by: Mothblocks <35135081+Jared-Fogle@users.noreply.github.com>
This commit is contained in:
silicons
2021-02-04 13:45:15 -07:00
committed by GitHub
parent 4839c20b82
commit e06bc80172
@@ -177,7 +177,7 @@
if("PRG_edit")
if(!computer || !authenticated || !target_id_card)
return
var/new_name = params["name"]
var/new_name = reject_bad_name(params["name"]) // if reject bad name fails, the edit will just not go through instead of discarding all input, as new_name would be blank.
if(!new_name)
return
target_id_card.registered_name = new_name
@@ -192,7 +192,7 @@
return
if(target == "Custom")
var/custom_name = params["custom_name"]
var/custom_name = reject_bad_name(params["custom_name"]) // if reject bad name fails, the edit will just not go through, as custom_name would be empty
if(custom_name)
target_id_card.assignment = custom_name
target_id_card.update_label()