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