[MIRROR] Encode changes (#11301)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-08-05 01:23:19 +02:00
committed by GitHub
co-authored by Kashargul
parent 5e6a4639d0
commit 4e2361f8df
202 changed files with 370 additions and 408 deletions
+1 -1
View File
@@ -188,7 +188,7 @@
switch(param)
if("reason")
if(!value)
value = sanitize(tgui_input_text(user, "Insert the new reason for [pckey]'s ban", "New Reason", "[reason]", null))
value = tgui_input_text(user, "Insert the new reason for [pckey]'s ban", "New Reason", "[reason]", MAX_MESSAGE_LEN)
value = sql_sanitize_text(value)
if(!value)
to_chat(user, "Cancelled")
+1 -1
View File
@@ -18,7 +18,7 @@
/client/proc/admin_memo_write()
var/savefile/F = new(MEMOFILE)
if(F)
var/memo = sanitize(tgui_input_text(src,"Type your memo\n(Leaving it blank will delete your current memo):","Write Memo",null, multiline = TRUE, prevent_enter = TRUE), extra = 0)
var/memo = tgui_input_text(src,"Type your memo\n(Leaving it blank will delete your current memo):","Write Memo",null, multiline = TRUE, prevent_enter = TRUE)
switch(memo)
if(null)
return
+2 -2
View File
@@ -329,7 +329,7 @@ ADMIN_VERB(stealth, R_STEALTH, "Stealth Mode", "Toggle stealth.", "Admin.Game")
set name = "Make Sound"
set desc = "Display a message to everyone who can hear the target"
if(O)
var/message = sanitize(tgui_input_text(usr, "What do you want the message to be?", "Make Sound"))
var/message = tgui_input_text(usr, "What do you want the message to be?", "Make Sound", "", MAX_MESSAGE_LEN)
if(!message)
return
O.audible_message(message)
@@ -401,7 +401,7 @@ ADMIN_VERB(deadmin, R_NONE, "DeAdmin", "Shed your admin powers.", ADMIN_CATEGORY
var/mob/living/silicon/S = tgui_input_list(usr, "Select silicon.", "Rename Silicon.", GLOB.silicon_mob_list)
if(!S) return
var/new_name = sanitizeSafe(tgui_input_text(src, "Enter new name. Leave blank or as is to cancel.", "[S.real_name] - Enter new silicon name", S.real_name))
var/new_name = sanitizeSafe(tgui_input_text(src, "Enter new name. Leave blank or as is to cancel.", "[S.real_name] - Enter new silicon name", S.real_name, encode = FALSE))
if(new_name && new_name != S.real_name)
log_and_message_admins("has renamed the silicon '[S.real_name]' to '[new_name]'")
S.SetName(new_name)
+2 -2
View File
@@ -319,7 +319,7 @@
var/obj/item/borg/upgrade/U = new new_upgrade(null)
if(new_upgrade == /obj/item/borg/upgrade/utility/rename)
var/obj/item/borg/upgrade/utility/rename/UN = U
var/new_name = sanitizeSafe(tgui_input_text(ui.user, "Enter new robot name", "Robot Reclassification", UN.heldname, MAX_NAME_LEN), MAX_NAME_LEN)
var/new_name = sanitizeSafe(tgui_input_text(ui.user, "Enter new robot name", "Robot Reclassification", UN.heldname, MAX_NAME_LEN, encode = FALSE), MAX_NAME_LEN)
if(new_name)
UN.heldname = new_name
U = UN
@@ -550,7 +550,7 @@
if("edit_law")
var/datum/ai_law/AL = locate(params["edit_law"]) in target.laws.all_laws()
if(AL)
var/new_law = sanitize(tgui_input_text(ui.user, "Enter new law. Leaving the field blank will cancel the edit.", "Edit Law", AL.law))
var/new_law = tgui_input_text(ui.user, "Enter new law. Leaving the field blank will cancel the edit.", "Edit Law", AL.law, MAX_MESSAGE_LEN)
if(new_law && new_law != AL.law)
AL.law = new_law
target.lawsync()
+3 -3
View File
@@ -27,13 +27,13 @@
body = html2paper_markup(body)
//ChompEDIT end
var/new_title = sanitize(tgui_input_text(src,"Write a good title for the news update. Note: HTML is NOT supported.","Write News", title), extra = 0)
var/new_title = tgui_input_text(src,"Write a good title for the news update. Note: HTML is NOT supported.","Write News", title, MAX_MESSAGE_LEN)
if(!new_title)
return
var/new_body = sanitize(tgui_input_text(src,"Write the body of the news update here. Note: HTML is NOT supported, however paper markup is supported. \n\
var/new_body = tgui_input_text(src,"Write the body of the news update here. Note: HTML is NOT supported, however paper markup is supported. \n\
Hitting enter will automatically add a line break. \n\
Valid markup includes: \[b\], \[i\], \[u\], \[large\], \[h1\], \[h2\], \[h3\]\ \[*\], \[hr\], \[small\], \[list\], \[table\], \[grid\], \
\[row\], \[cell\], \[logo\], \[sglogo\].","Write News", body, multiline = TRUE, prevent_enter = TRUE), extra = 0)
\[row\], \[cell\], \[logo\], \[sglogo\].","Write News", body, MAX_MESSAGE_LEN, TRUE, prevent_enter = TRUE)
new_body = paper_markup2html(new_body)
+1 -1
View File
@@ -796,7 +796,7 @@
qdel(ai_holder_old) //Only way I could make #TESTING - Unable to be GC'd to stop. del() logs show it works.
L.ai_holder_type = tgui_input_list(ui.user, "Choose AI holder", "AI Type", typesof(/datum/ai_holder/))
L.initialize_ai_holder()
L.faction = sanitize(tgui_input_text(ui.user, "Please input AI faction", "AI faction", "neutral"))
L.faction = tgui_input_text(ui.user, "Please input AI faction", "AI faction", "neutral", MAX_MESSAGE_LEN)
L.a_intent = tgui_input_list(ui.user, "Please choose AI intent", "AI intent", list(I_HURT, I_HELP))
if(tgui_alert(ui.user, "Make mob wake up? This is needed for carbon mobs.", "Wake mob?", list("Yes", "No")) == "Yes")
L.AdjustSleeping(-100)
+16 -16
View File
@@ -211,12 +211,12 @@
mins = min(525599,mins)
minutes = CMinutes + mins
duration = GetExp(minutes)
reason = sanitize(tgui_input_text(usr,"Reason?","reason",reason2))
reason = tgui_input_text(usr,"Reason?","reason",reason2, MAX_MESSAGE_LEN)
if(!reason) return
if("No")
temp = 0
duration = "Perma"
reason = sanitize(tgui_input_text(usr,"Reason?","reason",reason2))
reason = tgui_input_text(usr,"Reason?","reason",reason2, MAX_MESSAGE_LEN)
if(!reason) return
log_admin("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]")
@@ -630,7 +630,7 @@
if(check_rights(R_MOD, 0) && !check_rights(R_BAN, 0) && mins > CONFIG_GET(number/mod_job_tempban_max))
to_chat(usr, span_filter_adminlog(span_warning("Moderators can only job tempban up to [CONFIG_GET(number/mod_job_tempban_max)] minutes!")))
return
var/reason = sanitize(tgui_input_text(usr,"Reason?","Please State Reason",""))
var/reason = tgui_input_text(usr,"Reason?","Please State Reason","", MAX_MESSAGE_LEN)
if(!reason)
return
@@ -655,7 +655,7 @@
return 1
if("No")
if(!check_rights(R_BAN)) return
var/reason = sanitize(tgui_input_text(usr,"Reason?","Please State Reason",""))
var/reason = tgui_input_text(usr,"Reason?","Please State Reason","", MAX_MESSAGE_LEN)
if(reason)
var/msg
for(var/job in notbannedlist)
@@ -712,7 +712,7 @@
if (ismob(M))
if(!check_if_greater_rights_than(M.client))
return
var/reason = sanitize(tgui_input_text(usr, "Please enter reason.", multiline = TRUE, prevent_enter = TRUE))
var/reason = tgui_input_text(usr, "Please enter reason.", "", "", MAX_MESSAGE_LEN, TRUE, prevent_enter = TRUE)
if(!reason)
return
@@ -763,7 +763,7 @@
to_chat(usr, span_warning("Moderators can only job tempban up to [CONFIG_GET(number/mod_tempban_max)] minutes!"))
return
if(mins >= 525600) mins = 525599
var/reason = sanitize(tgui_input_text(usr,"Reason?","reason","Griefer"))
var/reason = tgui_input_text(usr,"Reason?","reason","Griefer", MAX_MESSAGE_LEN)
if(!reason)
return
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 1, mins)
@@ -788,7 +788,7 @@
//qdel(M) // See no reason why to delete mob. Important stuff can be lost. And ban can be lifted before round ends.
if("No")
if(!check_rights(R_BAN)) return
var/reason = sanitize(tgui_input_text(usr,"Reason?","reason","Griefer"))
var/reason = tgui_input_text(usr,"Reason?","reason","Griefer", MAX_MESSAGE_LEN)
if(!reason)
return
switch(tgui_alert(usr,"IP ban?","IP Ban",list("Yes","No","Cancel")))
@@ -1330,7 +1330,7 @@
return
if(L.can_centcom_reply())
var/input = sanitize(tgui_input_text(src.owner, "Please enter a message to reply to [key_name(L)] via their headset.","Outgoing message from CentCom", ""))
var/input = tgui_input_text(src.owner, "Please enter a message to reply to [key_name(L)] via their headset.","Outgoing message from CentCom", "", MAX_MESSAGE_LEN)
if(!input) return
to_chat(src.owner, span_filter_adminlog("You sent [input] to [L] via a secure channel."))
@@ -1355,7 +1355,7 @@
to_chat(usr, span_filter_adminlog("The person you are trying to contact is not wearing a headset"))
return
var/input = sanitize(tgui_input_text(src.owner, "Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from a shadowy figure...", ""))
var/input = tgui_input_text(src.owner, "Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from a shadowy figure...", "", MAX_MESSAGE_LEN)
if(!input) return
to_chat(src.owner, span_filter_adminlog("You sent [input] to [H] via a secure channel."))
@@ -1652,7 +1652,7 @@
src.access_news_network()
else if(href_list["ac_set_channel_name"])
src.admincaster_feed_channel.channel_name = sanitizeSafe(tgui_input_text(usr, "Provide a Feed Channel Name", "Network Channel Handler", ""))
src.admincaster_feed_channel.channel_name = sanitizeSafe(tgui_input_text(usr, "Provide a Feed Channel Name", "Network Channel Handler", "", encode = FALSE))
src.access_news_network()
else if(href_list["ac_set_channel_lock"])
@@ -1680,15 +1680,15 @@
var/list/available_channels = list()
for(var/datum/feed_channel/F in news_network.network_channels)
available_channels += F.channel_name
src.admincaster_feed_channel.channel_name = sanitizeSafe(tgui_input_list(usr, "Choose receiving Feed Channel", "Network Channel Handler", available_channels ))
src.admincaster_feed_channel.channel_name = tgui_input_list(usr, "Choose receiving Feed Channel", "Network Channel Handler", available_channels)
src.access_news_network()
else if(href_list["ac_set_new_title"])
src.admincaster_feed_message.title = sanitize(tgui_input_text(usr, "Enter the Feed title", "Network Channel Handler", ""))
src.admincaster_feed_message.title = tgui_input_text(usr, "Enter the Feed title", "Network Channel Handler", "", MAX_MESSAGE_LEN)
src.access_news_network()
else if(href_list["ac_set_new_message"])
src.admincaster_feed_message.body = sanitize(tgui_input_text(usr, "Write your Feed story", "Network Channel Handler", "", multiline = TRUE, prevent_enter = TRUE))
src.admincaster_feed_message.body = tgui_input_text(usr, "Write your Feed story", "Network Channel Handler", "", MAX_MESSAGE_LEN, TRUE, prevent_enter = TRUE)
src.access_news_network()
else if(href_list["ac_submit_new_message"])
@@ -1730,11 +1730,11 @@
src.access_news_network()
else if(href_list["ac_set_wanted_name"])
src.admincaster_feed_message.author = sanitize(tgui_input_text(usr, "Provide the name of the Wanted person", "Network Security Handler", ""))
src.admincaster_feed_message.author = tgui_input_text(usr, "Provide the name of the Wanted person", "Network Security Handler", "", MAX_MESSAGE_LEN)
src.access_news_network()
else if(href_list["ac_set_wanted_desc"])
src.admincaster_feed_message.body = sanitize(tgui_input_text(usr, "Provide the a description of the Wanted person and any other details you deem important", "Network Security Handler", ""))
src.admincaster_feed_message.body = tgui_input_text(usr, "Provide the a description of the Wanted person and any other details you deem important", "Network Security Handler", "", MAX_MESSAGE_LEN)
src.access_news_network()
else if(href_list["ac_submit_wanted"])
@@ -1839,7 +1839,7 @@
src.access_news_network()
else if(href_list["ac_set_signature"])
src.admincaster_signature = sanitize(tgui_input_text(usr, "Provide your desired signature", "Network Identity Handler", ""))
src.admincaster_signature = tgui_input_text(usr, "Provide your desired signature", "Network Identity Handler", "", MAX_MESSAGE_LEN)
src.access_news_network()
else if(href_list["populate_inactive_customitems"])
+1 -1
View File
@@ -7,7 +7,7 @@
to_chat(src, "Only administrators may use this command.")
return
var/input = sanitize(tgui_input_text(usr, "Enter the description of the custom event. Be descriptive. To cancel the event, make this blank or hit cancel.", "Custom Event", GLOB.custom_event_msg, MAX_PAPER_MESSAGE_LEN, TRUE, prevent_enter = TRUE), MAX_PAPER_MESSAGE_LEN, extra = 0)
var/input = tgui_input_text(usr, "Enter the description of the custom event. Be descriptive. To cancel the event, make this blank or hit cancel.", "Custom Event", GLOB.custom_event_msg, MAX_PAPER_MESSAGE_LEN, TRUE, prevent_enter = TRUE)
if(!input || input == "")
GLOB.custom_event_msg = null
log_admin("[usr.key] has cleared the custom event text.")
+1 -1
View File
@@ -152,7 +152,7 @@
if(tgui_alert(pai, "Do you want to load your pAI data?", "Load", list("Yes", "No")) == "Yes")
pai.savefile_load(pai)
else
pai.name = sanitizeSafe(tgui_input_text(pai, "Enter your pAI name:", "pAI Name", "Personal AI"))
pai.name = sanitizeSafe(tgui_input_text(pai, "Enter your pAI name:", "pAI Name", "Personal AI", encode = FALSE))
card.setPersonality(pai)
for(var/datum/paiCandidate/candidate in paiController.pai_candidates)
if(candidate.key == choice.key)
+5 -5
View File
@@ -44,8 +44,8 @@ ADMIN_VERB_AND_CONTEXT_MENU(add_mob_for_narration, R_FUN, "Narrate Entity (Add r
gets logged in case of abuse."))
log_and_message_admins("has added [L.ckey]'s mob to their entity narrate list", user)
return
var/unique_name = sanitize(tgui_input_text(user, "Please give the entity a unique name to track internally. \
This doesn't override how it appears in game", "tracker", L.name))
var/unique_name = tgui_input_text(user, "Please give the entity a unique name to track internally. \
This doesn't override how it appears in game", "tracker", L.name, MAX_MESSAGE_LEN)
if(unique_name in holder.entity_names)
to_chat(user, span_notice("[unique_name] is not unique! Pick another!"))
SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/add_mob_for_narration, L) //Recursively calling ourselves until cancelled or a unique name is given.
@@ -57,8 +57,8 @@ ADMIN_VERB_AND_CONTEXT_MENU(add_mob_for_narration, R_FUN, "Narrate Entity (Add r
//Covering functionality for turfs and objs. We need static type to access the name var
else if(istype(E, /atom))
var/atom/A = E
var/unique_name = sanitize(tgui_input_text(user, "Please give the entity a unique name to track internally. \
This doesn't override how it appears in game", "tracker", A.name))
var/unique_name = tgui_input_text(user, "Please give the entity a unique name to track internally. \
This doesn't override how it appears in game", "tracker", A.name, MAX_MESSAGE_LEN)
if(unique_name in holder.entity_names)
to_chat(user, span_notice("[unique_name] is not unique! Pick another!"))
SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/add_mob_for_narration, A)
@@ -148,7 +148,7 @@ ADMIN_VERB(narrate_mob_args, R_FUN, "Narrate Entity", "Narrate entities using po
if(our_entity.client) //Making sure we can't speak for players
log_and_message_admins("used entity-narrate to speak through [our_entity.ckey]'s mob", user)
if(!message)
message = tgui_input_text(user, "Input what you want [our_entity] to [mode]", "narrate", null) //say/emote sanitize already
message = tgui_input_text(user, "Input what you want [our_entity] to [mode]", "narrate", null, encode = FALSE) //say/emote sanitize already
if(message && mode == "Speak")
our_entity.say(message)
else if(message && mode == "Emote")
+1 -1
View File
@@ -67,7 +67,7 @@ Eventkit verb to be used to spawn the obj/effect/landmarks defined under code\ga
ET.delete_me = TRUE
qdel(ET)
if("Manage Other's Triggers")
var/other_ckey = sanitize(tgui_input_text(src, "input trigger owner's ckey", "CKEY", ""))
var/other_ckey = tgui_input_text(src, "input trigger owner's ckey", "CKEY", "", MAX_MESSAGE_LEN)
var/others_list = GLOB.event_triggers[other_ckey]
if(!LAZYLEN(others_list))
to_chat(src, span_notice("[other_ckey] doesn't have any landmarks to manage!"))
+1 -1
View File
@@ -2,7 +2,7 @@
set category = "IC.Game"
set name = "Pray"
var/raw_msg = sanitize(tgui_input_text(src, "Prayers are sent to staff but do not open tickets or go to Discord. If you have a technical difficulty or an event/spice idea/hook - please ahelp instead. Thank you!", "Pray", null, MAX_MESSAGE_LEN))
var/raw_msg = tgui_input_text(src, "Prayers are sent to staff but do not open tickets or go to Discord. If you have a technical difficulty or an event/spice idea/hook - please ahelp instead. Thank you!", "Pray", null, MAX_MESSAGE_LEN)
if(!raw_msg) return
if(src.client)
+3 -3
View File
@@ -642,7 +642,7 @@ ADMIN_VERB(respawn_character, (R_ADMIN|R_REJUVINATE), "Spawn Character", "(Re)Sp
if(!check_rights_for(src, R_HOLDER))
return
var/input = sanitize(tgui_input_text(usr, "Please enter anything you want the AI to do. Anything. Serious.", "What?", ""))
var/input = tgui_input_text(usr, "Please enter anything you want the AI to do. Anything. Serious.", "What?", "", MAX_MESSAGE_LEN)
if(!input)
return
for(var/mob/living/silicon/ai/M in GLOB.mob_list)
@@ -694,8 +694,8 @@ ADMIN_VERB(respawn_character, (R_ADMIN|R_REJUVINATE), "Spawn Character", "(Re)Sp
if(!check_rights_for(src, R_HOLDER))
return
var/input = sanitize(tgui_input_text(usr, "Please enter anything you want. Anything. Serious.", "What?", "", multiline = TRUE, prevent_enter = TRUE), extra = 0)
var/customname = sanitizeSafe(tgui_input_text(usr, "Pick a title for the report.", "Title"))
var/input = tgui_input_text(usr, "Please enter anything you want. Anything. Serious.", "What?", "", MAX_MESSAGE_LEN, TRUE, prevent_enter = TRUE)
var/customname = sanitizeSafe(tgui_input_text(usr, "Pick a title for the report.", "Title", encode = FALSE))
if(!input)
return
if(!customname)
+1 -1
View File
@@ -43,7 +43,7 @@ var/const/commandos_possible = 6 //if more Commandos are needed in the future
choice = null
while(!choice)
choice = sanitize(tgui_input_text(src, "Please specify which mission the strike team shall undertake.", "Specify Mission", ""))
choice = tgui_input_text(src, "Please specify which mission the strike team shall undertake.", "Specify Mission", "", MAX_MESSAGE_LEN)
if(!choice)
if(tgui_alert(usr, "Error, no mission set. Do you want to exit the setup process?","Strike Team",list("Yes","No"))!="No")
return