mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Sanitizes Circuit Inputs
This commit is contained in:
@@ -112,6 +112,8 @@ list[](
|
||||
|
||||
/datum/integrated_io/proc/write_data_to_pin(var/new_data)
|
||||
if(isnull(new_data) || isnum(new_data) || istext(new_data) || isweakref(new_data)) // Anything else is a type we don't want.
|
||||
if(istext(new_data))
|
||||
new_data = sanitizeSafe(new_data, MAX_MESSAGE_LEN, 0, 0)
|
||||
data = new_data
|
||||
holder.on_data_written()
|
||||
|
||||
|
||||
@@ -4,11 +4,14 @@
|
||||
|
||||
/datum/integrated_io/string/ask_for_pin_data(mob/user)
|
||||
var/new_data = input("Please type in a string.","[src] string writing") as null|text
|
||||
if(holder.check_interactivity(user) )
|
||||
new_data = sanitizeSafe(new_data, MAX_MESSAGE_LEN, 0, 0)
|
||||
|
||||
if(new_data && holder.check_interactivity(user) )
|
||||
to_chat(user, "<span class='notice'>You input [new_data ? "new_data" : "NULL"] into the pin.</span>")
|
||||
write_data_to_pin(new_data)
|
||||
|
||||
/datum/integrated_io/string/write_data_to_pin(var/new_data)
|
||||
new_data = sanitizeSafe(new_data, MAX_MESSAGE_LEN, 0, 0)
|
||||
if(isnull(new_data) || istext(new_data))
|
||||
data = new_data
|
||||
holder.on_data_written()
|
||||
|
||||
@@ -125,6 +125,7 @@
|
||||
if("string")
|
||||
accepting_refs = 0
|
||||
new_data = input("Now type in a string.","[src] string writing") as null|text
|
||||
new_data = sanitizeSafe(new_data, MAX_MESSAGE_LEN, 0, 0)
|
||||
if(istext(new_data) && CanInteract(user, physical_state))
|
||||
data_to_write = new_data
|
||||
to_chat(user, "<span class='notice'>You set \the [src]'s memory to \"[new_data]\".</span>")
|
||||
|
||||
Reference in New Issue
Block a user