Sanitization

This commit is contained in:
Casey
2022-10-02 17:58:34 +00:00
committed by CHOMPStation2
parent dbc2cba71c
commit d8b03336e5
27 changed files with 115 additions and 50 deletions
@@ -154,12 +154,13 @@ list[](
var/new_data = null
switch(type_to_use)
if("string")
new_data = tgui_input_text(usr, "Now type in a string.","[src] string writing", istext(default) ? default : null)
new_data = tgui_input_text(usr, "Now type in a string.","[src] string writing", istext(default) ? default : null, MAX_NAME_LEN)
new_data = sanitize(new_data,MAX_NAME_LEN)
if(istext(new_data) && holder.check_interactivity(user) )
to_chat(user, "<span class='notice'>You input [new_data] into the pin.</span>")
return new_data
if("number")
new_data = tgui_input_number(usr, "Now type in a number.","[src] number writing", isnum(default) ? default : null)
new_data = tgui_input_number(usr, "Now type in a number.","[src] number writing", isnum(default) ? default : null, MAX_NAME_LEN)
if(isnum(new_data) && holder.check_interactivity(user) )
to_chat(user, "<span class='notice'>You input [new_data] into the pin.</span>")
return new_data
@@ -122,7 +122,7 @@
switch(type_to_use)
if("string")
accepting_refs = 0
new_data = tgui_input_text(usr, "Now type in a string.","[src] string writing")
new_data = tgui_input_text(usr, "Now type in a string.","[src] string writing", null, MAX_MESSAGE_LEN)
new_data = sanitizeSafe(new_data, MAX_MESSAGE_LEN, 0, 0)
if(istext(new_data) && CanInteract(user, GLOB.tgui_physical_state))
data_to_write = new_data
@@ -72,7 +72,8 @@
power_draw_per_use = 4
/obj/item/integrated_circuit/input/textpad/ask_for_input(mob/user)
var/new_input = tgui_input_text(user, "Enter some words, please.","Number pad", get_pin_data(IC_OUTPUT, 1))
var/new_input = tgui_input_text(user, "Enter some words, please.","Number pad", get_pin_data(IC_OUTPUT, 1),MAX_NAME_LEN)
new_input = sanitize(new_input,MAX_NAME_LEN)
if(istext(new_input) && CanInteract(user, GLOB.tgui_physical_state))
set_pin_data(IC_OUTPUT, 1, new_input)
push_data()
@@ -96,13 +96,14 @@
switch(type_to_use)
if("string")
accepting_refs = 0
new_data = tgui_input_text(usr, "Now type in a string.","[src] string writing")
new_data = tgui_input_text(usr, "Now type in a string.","[src] string writing", MAX_NAME_LEN)
new_data = sanitize(new_data,MAX_NAME_LEN)
if(istext(new_data) && CanInteract(user, GLOB.tgui_physical_state))
O.data = new_data
to_chat(user, "<span class='notice'>You set \the [src]'s memory to [O.display_data(O.data)].</span>")
if("number")
accepting_refs = 0
new_data = tgui_input_number(usr, "Now type in a number.","[src] number writing")
new_data = tgui_input_number(usr, "Now type in a number.","[src] number writing", MAX_NAME_LEN)
if(isnum(new_data) && CanInteract(user, GLOB.tgui_physical_state))
O.data = new_data
to_chat(user, "<span class='notice'>You set \the [src]'s memory to [O.display_data(O.data)].</span>")