[MIRROR] Encode changes (#11301)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-08-04 16:23:19 -07:00
committed by GitHub
parent 5e6a4639d0
commit 4e2361f8df
202 changed files with 370 additions and 408 deletions

View File

@@ -323,7 +323,7 @@
. = TRUE
switch(action)
if("rename")
var/new_name = sanitizeSafe(tgui_input_text(ui.user,"Please enter your name.","Communicator",ui.user.name) )
var/new_name = sanitizeSafe(tgui_input_text(ui.user,"Please enter your name.","Communicator",ui.user.name, encode = FALSE))
if(new_name)
register_device(new_name)
@@ -377,7 +377,7 @@
to_chat(ui.user, span_danger("Error: Cannot connect to Exonet node."))
return FALSE
var/their_address = params["message"]
var/text = sanitizeSafe(tgui_input_text(ui.user,"Enter your message.","Text Message"))
var/text = sanitizeSafe(tgui_input_text(ui.user,"Enter your message.","Text Message", encode = FALSE))
if(text)
exonet.send_message(their_address, "text", text)
im_list += list(list("address" = exonet.address, "to_address" = their_address, "im" = text))

View File

@@ -133,7 +133,7 @@
return
var/timeout = world.time + 600
var/reason = sanitize(tgui_input_text(user, "Reason:","Why do you require this item?",""))
var/reason = tgui_input_text(user, "Reason:","Why do you require this item?","", MAX_MESSAGE_LEN)
if(world.time > timeout)
to_chat(user, span_warning("Error. Request timed out."))
return
@@ -155,7 +155,7 @@
return
if(href_list["edit"])
var/new_val = sanitize(tgui_input_text(user, href_list["edit"], "Enter the new value for this field:", href_list["default"]))
var/new_val = tgui_input_text(user, href_list["edit"], "Enter the new value for this field:", href_list["default"], MAX_MESSAGE_LEN)
if(!new_val)
return
@@ -221,7 +221,7 @@
if(href_list["edit"])
var/field = tgui_alert(user, "Select which field to edit", "Field?", list("Name", "Quantity", "Value"))
var/new_val = sanitize(tgui_input_text(user, href_list["edit"], "Enter the new value for this field:", href_list["default"]))
var/new_val = tgui_input_text(user, href_list["edit"], "Enter the new value for this field:", href_list["default"])
if(!new_val)
return
@@ -244,7 +244,7 @@
// Else clause means they're editing/deleting the whole export report, rather than a specific item in it
else if(href_list["edit"])
var/new_val = sanitize(tgui_input_text(user, href_list["edit"], "Enter the new value for this field:", href_list["default"]))
var/new_val = tgui_input_text(user, href_list["edit"], "Enter the new value for this field:", href_list["default"])
if(!new_val)
return
@@ -291,7 +291,7 @@
post_status("alert", href_list["alert"])
internal_data["stat_display_special"] = href_list["alert"]
if("setmsg")
internal_data["stat_display_line[href_list["line"]]"] = reject_bad_text(sanitize(tgui_input_text(usr, "Line 1", "Enter Message Text", internal_data["stat_display_line[href_list["line"]]"], 40), 40), 40)
internal_data["stat_display_line[href_list["line"]]"] = reject_bad_text(tgui_input_text(usr, "Line 1", "Enter Message Text", internal_data["stat_display_line[href_list["line"]]"], 40), 40)
else
post_status(href_list["stat_display"])
internal_data["stat_display_special"] = href_list["stat_display"]

View File

@@ -153,7 +153,7 @@
if(choice)
var/obj/item/communicator/chosen_communicator = choice
var/mob/observer/dead/O = src
var/text_message = sanitize(tgui_input_text(src, "What do you want the message to say?", multiline = TRUE))
var/text_message = sanitize(tgui_input_text(src, "What do you want the message to say?", encode = FALSE, multiline = TRUE), MAX_MESSAGE_LEN, FALSE, FALSE, TRUE)
if(text_message && O.exonet)
O.exonet.send_message(chosen_communicator.exonet.address, "text", text_message)

View File

@@ -328,7 +328,7 @@ GLOBAL_LIST_EMPTY(GPS_list)
if(href_list["tag"])
var/a = tgui_input_text(usr, "Please enter desired tag.", name, gps_tag, 10)
a = uppertext(copytext(sanitize(a), 1, 11))
a = uppertext(copytext(a, 1, 11))
if(in_range(src, usr))
gps_tag = a
name = "global positioning system ([gps_tag])"

View File

@@ -43,7 +43,7 @@
user.audible_message(span_infoplain(span_bold("[user.GetVoice()]") + "[user.GetAltName()] broadcasts, " + span_large("\"[message]\"")), runemessage = message)
/obj/item/megaphone/attack_self(var/mob/living/user)
var/message = sanitize(tgui_input_text(user, "Shout a message?", "Megaphone", null))
var/message = tgui_input_text(user, "Shout a message?", "Megaphone", null, MAX_MESSAGE_LEN)
if(!message)
return
message = capitalize(message)

View File

@@ -362,7 +362,7 @@
if(2)
radio.ToggleReception()
if(href_list["setlaws"])
var/newlaws = sanitize(tgui_input_text(usr, "Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.pai_laws, multiline = TRUE, prevent_enter = TRUE))
var/newlaws = sanitize(tgui_input_text(usr, "Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.pai_laws, MAX_MESSAGE_LEN, encode = FALSE, multiline = TRUE, prevent_enter = TRUE), MAX_MESSAGE_LEN, FALSE, FALSE, TRUE)
if(newlaws)
pai.pai_laws = newlaws
to_chat(pai, "Your supplemental directives have been updated. Your new directives are:")

View File

@@ -17,14 +17,14 @@
desc = "[initial(desc)] This one is assigned to [user.real_name]."
named = 1
/* //Another way of naming the device. Gives more freedom, but could lead to issues.
device_name = sanitize(tgui_input_text(user, "What would you like to name your device? You must input a name before the device can be used.", "Name your device", "", MAX_NAME_LEN))
device_name = tgui_input_text(user, "What would you like to name your device? You must input a name before the device can be used.", "Name your device", "", MAX_NAME_LEN)
if(!device_name)
return
name = "[initial(name)] - [device_name]"
named = 1
*/
var/message = sanitize(tgui_input_text(user,"Choose a message to relay to those around you."))
var/message = tgui_input_text(user,"Choose a message to relay to those around you.", "", "", MAX_MESSAGE_LEN)
if(message)
audible_message("[icon2html(src, user.client)] \The [src.name] states, \"[message]\"", runemessage = "synthesized speech")
if(ismob(loc))

View File

@@ -19,13 +19,13 @@
/obj/item/ticket_printer/proc/print_a_ticket(mob/user)
var/ticket_name = sanitize(tgui_input_text(user, "The Name of the person you are issuing the ticket to.", "Name", max_length = 100))
var/ticket_name = tgui_input_text(user, "The Name of the person you are issuing the ticket to.", "Name", max_length = 100)
if(length(ticket_name) > 100)
tgui_alert_async(user, "Entered name too long. 100 character limit.","Error")
return
if(!ticket_name)
return
var/details = sanitize(tgui_input_text(user, "What is the ticket for? Avoid entering personally identifiable information in this section. This information should not be used to harrass or otherwise make the person feel uncomfortable. (Max length: 200)", "Ticket Details", max_length = 200))
var/details = tgui_input_text(user, "What is the ticket for? Avoid entering personally identifiable information in this section. This information should not be used to harrass or otherwise make the person feel uncomfortable. (Max length: 200)", "Ticket Details", max_length = 200)
if(length(details) > 200)
tgui_alert_async(user, "Entered details too long. 200 character limit.","Error")
return
@@ -70,13 +70,13 @@
/obj/item/ticket_printer/train/print_a_ticket(mob/user)
var/ticket_name = sanitize(tgui_input_text(user, "The Name of the person you are issuing the ticket to.", "Name", max_length = 100))
var/ticket_name = tgui_input_text(user, "The Name of the person you are issuing the ticket to.", "Name", max_length = 100)
if(length(ticket_name) > 100)
tgui_alert_async(user, "Entered name too long. 100 character limit.","Error")
return
if(!ticket_name)
return
var/details = sanitize(tgui_input_text(user, "What is the ticket for? This could be anything like travel to a destination or permission to do something! This is not official and does not override any rules or authorities on the station.", "Ticket Details", max_length = 200))
var/details = tgui_input_text(user, "What is the ticket for? This could be anything like travel to a destination or permission to do something! This is not official and does not override any rules or authorities on the station.", "Ticket Details", max_length = 200)
if(length(details) > 200)
tgui_alert_async(user, "Entered details too long. 200 character limit.","Error")
return

View File

@@ -138,7 +138,7 @@ This device records all warnings given and teleport events for admin review in c
to_chat(user, span_warning("The translocator can't support any more beacons!"))
return
var/new_name = html_encode(tgui_input_text(user,"New beacon's name (2-20 char):","[src]",null,20))
var/new_name = tgui_input_text(user,"New beacon's name (2-20 char):","[src]",null,20)
if(!check_menu(user))
return

View File

@@ -69,7 +69,6 @@
return 1
if(href_list["channel"])
var/nc = tgui_input_text(usr, "Channel name", "Select new channel name", channel, MAX_NAME_LEN)
nc = sanitize(nc,MAX_NAME_LEN)
if(nc)
channel = nc
camera.c_tag = channel

View File

@@ -23,11 +23,11 @@
to_chat(usr, "The hailer is fried. The tiny input screen just shows a waving ASCII penis.")
return
var/new_message = tgui_input_text(usr, "Please enter new message (leave blank to reset).")
var/new_message = tgui_input_text(usr, "Please enter new message (leave blank to reset).", max_length = MAX_MESSAGE_LEN)
if(!new_message || new_message == "")
use_message = "Halt! Security!"
else
use_message = capitalize(copytext(sanitize(new_message), 1, MAX_MESSAGE_LEN))
use_message = capitalize(new_message)
to_chat(usr, "You configure the hailer to shout \"[use_message]\".")