[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

@@ -12,6 +12,9 @@
/// Simply removes the < and > characters, and limits the length of the message.
#define STRIP_HTML_SIMPLE(text, limit) (GLOB.angular_brackets.Replace(copytext(text, 1, limit), ""))
/// Removes everything enclose in < and > inclusive of the bracket, and limits the length of the message.
#define STRIP_HTML_FULL(text, limit) (GLOB.html_tags.Replace(copytext(text, 1, limit), ""))
/// Removes characters incompatible with file names.
#define SANITIZE_FILENAME(text) (GLOB.filename_forbidden_chars.Replace(text, ""))

View File

@@ -6,6 +6,9 @@ GLOBAL_DATUM_INIT(is_valid_url, /regex, regex("((?:https://)\[-a-zA-Z0-9@:%._+~#
//All < and > characters
GLOBAL_DATUM_INIT(angular_brackets, /regex, regex(@"[<>]", "g"))
//All characters between < a > inclusive of the bracket
GLOBAL_DATUM_INIT(html_tags, /regex, regex(@"<.*?>", "g"))
GLOBAL_DATUM_INIT(is_color, /regex, regex("^#\[0-9a-fA-F]{6}$"))
//All characters forbidden by filenames: ", \, \n, \t, /, ?, %, *, :, |, <, >, ..

View File

@@ -150,18 +150,32 @@ GLOBAL_LIST_INIT(alphabet_upper, list("A","B","C","D","E","F","G","H","I","J","K
return output
//Returns null if there is any bad text in the string
/proc/reject_bad_text(var/text, var/max_length=512)
if(length(text) > max_length) return //message too long
var/non_whitespace = 0
for(var/i=1, i<=length(text), i++)
switch(text2ascii(text,i))
if(62,60,92,47) return //rejects the text if it contains these bad characters: <, >, \ or /
if(127 to 255) return //rejects weird letters like <20>
if(0 to 31) return //more weird stuff
if(32) continue //whitespace
else non_whitespace = 1
if(non_whitespace) return text //only accepts the text if it has some non-spaces
/**
* Returns the text if properly formatted, or null else.
*
* Things considered improper:
* * Larger than max_length.
* * Presence of non-ASCII characters if asci_only is set to TRUE.
* * Only whitespaces, tabs and/or line breaks in the text.
* * Presence of the <, >, \ and / characters.
* * Presence of ASCII special control characters (horizontal tab and new line not included).
* */
/proc/reject_bad_text(text, max_length = 512, ascii_only = TRUE)
if(ascii_only)
if(length(text) > max_length)
return null
var/static/regex/non_ascii = regex(@"[^\x20-\x7E\t\n]")
if(non_ascii.Find(text))
return null
else if(length_char(text) > max_length)
return null
var/static/regex/non_whitespace = regex(@"\S")
if(!non_whitespace.Find(text))
return null
var/static/regex/bad_chars = regex(@"[\\<>/\x00-\x08\x11-\x1F]")
if(bad_chars.Find(text))
return null
return text
//Old variant. Haven't dared to replace in some places.
@@ -564,7 +578,7 @@ GLOBAL_LIST_EMPTY(text_tag_cache)
if(isnull(user_input)) // User pressed cancel
return
if(no_trim)
return copytext(html_encode(user_input), 1, max_length)
return copytext_char(html_encode(user_input), 1, max_length)
else
return trim(html_encode(user_input), max_length) //trim is "outside" because html_encode can expand single symbols into multiple symbols (such as turning < into &lt;)
@@ -583,7 +597,7 @@ GLOBAL_LIST_EMPTY(text_tag_cache)
if(isnull(user_input)) // User pressed cancel
return
if(no_trim)
return copytext(html_encode(user_input), 1, max_length)
return copytext_char(html_encode(user_input), 1, max_length)
else
return trim(html_encode(user_input), max_length)

View File

@@ -245,11 +245,11 @@ SUBSYSTEM_DEF(vote)
choices.Add(antag.role_text)
choices.Add("None")
if(VOTE_CUSTOM)
question = sanitizeSafe(tgui_input_text(usr, "What is the vote for?"))
question = tgui_input_text(usr, "What is the vote for?", max_length = MAX_MESSAGE_LEN)
if(!question)
return 0
for(var/i = 1 to 10)
var/option = capitalize(sanitize(tgui_input_text(usr, "Please enter an option or hit cancel to finish")))
var/option = capitalize(tgui_input_text(usr, "Please enter an option or hit cancel to finish", max_length = MAX_MESSAGE_LEN))
if(!option || mode || !usr.client)
break
choices.Add(option)

View File

@@ -238,7 +238,7 @@ SUBSYSTEM_DEF(vote)
if(!question)
return 0
for(var/i = 1 to 10)
var/option = capitalize(sanitize(tgui_input_text(usr, "Please enter an option or hit cancel to finish"))
var/option = capitalize(tgui_input_text(usr, "Please enter an option or hit cancel to finish", max_length = MAX_MESSAGE_LEN)
if(!option || mode || !usr.client)
break
choices.Add(option)

View File

@@ -422,7 +422,7 @@
setting["value"] = new_value
if ("string")
setting["value"] = tgui_input_text(user, "Enter new value for [setting["desc"]]", "Enter new value for [setting["desc"]]", setting["value"], encode = TRUE)
setting["value"] = tgui_input_text(user, "Enter new value for [setting["desc"]]", "Enter new value for [setting["desc"]]", setting["value"])
if ("number")
setting["value"] = tgui_input_number(user, "Enter new value for [setting["desc"]]", "Enter new value for [setting["desc"]]")
if ("color")

View File

@@ -22,7 +22,7 @@
to_chat(src, span_notice("We return our vocal glands to their original location."))
return
var/mimic_voice = sanitize(tgui_input_text(src, "Enter a name to mimic.", "Mimic Voice", null, MAX_NAME_LEN), MAX_NAME_LEN)
var/mimic_voice = tgui_input_text(src, "Enter a name to mimic.", "Mimic Voice", null, MAX_NAME_LEN)
if(!mimic_voice)
return

View File

@@ -193,7 +193,7 @@
assigned_role = new_role
else if (href_list["memory_edit"])
var/new_memo = sanitize(tgui_input_text(usr, "Write new memory", "Memory", memory, multiline = TRUE, prevent_enter = TRUE))
var/new_memo = tgui_input_text(usr, "Write new memory", "Memory", memory, MAX_MESSAGE_LEN, TRUE, prevent_enter = TRUE)
if (isnull(new_memo)) return
memory = new_memo
@@ -201,11 +201,11 @@
var/datum/mind/mind = locate(href_list["amb_edit"])
if(!mind)
return
var/new_ambition = tgui_input_text(usr, "Enter a new ambition", "Memory", mind.ambitions, multiline = TRUE, prevent_enter = TRUE)
var/new_ambition = tgui_input_text(usr, "Enter a new ambition", "Memory", mind.ambitions, MAX_MESSAGE_LEN, TRUE, prevent_enter = TRUE)
if(isnull(new_ambition))
return
if(mind)
mind.ambitions = sanitize(new_ambition)
mind.ambitions = new_ambition
to_chat(mind.current, span_warning("Your ambitions have been changed by higher powers, they are now: [mind.ambitions]"))
log_and_message_admins("made [key_name(mind.current)]'s ambitions be '[mind.ambitions]'.")
@@ -317,7 +317,7 @@
new_objective.target_amount = target_number
if ("custom")
var/expl = sanitize(tgui_input_text(usr, "Custom objective:", "Objective", objective ? objective.explanation_text : ""))
var/expl = tgui_input_text(usr, "Custom objective:", "Objective", objective ? objective.explanation_text : "", MAX_MESSAGE_LEN)
if (!expl) return
new_objective = new /datum/objective
new_objective.owner = src

View File

@@ -16,10 +16,10 @@
item_cost = 20
/datum/uplink_item/abstract/announcements/fake_centcom/extra_args(var/mob/user)
var/title = sanitize(tgui_input_text(usr, "Enter your announcement title.", "Announcement Title"))
var/title = tgui_input_text(usr, "Enter your announcement title.", "Announcement Title", "", MAX_MESSAGE_LEN)
if(!title)
return
var/message = sanitize(tgui_input_text(usr, "Enter your announcement message.", "Announcement Title"))
var/message = tgui_input_text(usr, "Enter your announcement message.", "Announcement Title", "", MAX_MESSAGE_LEN)
if(!message)
return
return list("title" = title, "message" = message)

View File

@@ -118,7 +118,7 @@
/datum/antagonist/proc/set_antag_name(var/mob/living/player)
// Choose a name, if any.
var/newname = sanitize(tgui_input_text(player, "You are a [role_text]. Would you like to change your name to something else?", "Name change", null, MAX_NAME_LEN), MAX_NAME_LEN)
var/newname = tgui_input_text(player, "You are a [role_text]. Would you like to change your name to something else?", "Name change", null, MAX_NAME_LEN)
if (newname)
player.real_name = newname
player.name = player.real_name

View File

@@ -43,10 +43,9 @@
return
var/new_ambitions = tgui_input_text(src, "Write a short sentence of what your character hopes to accomplish \
today as an antagonist. Remember that this is purely optional. It will be shown at the end of the \
round for everybody else.", "Ambitions", mind.ambitions, multiline = TRUE)
round for everybody else.", "Ambitions", mind.ambitions, MAX_MESSAGE_LEN, TRUE)
if(isnull(new_ambitions))
return
new_ambitions = sanitize(new_ambitions)
mind.ambitions = new_ambitions
if(new_ambitions)
to_chat(src, span_notice("You've set your goal to be '[new_ambitions]'."))

View File

@@ -97,7 +97,7 @@ var/datum/antagonist/rogue_ai/malf
testing("rogue_ai set_antag_name called on non-silicon mob [player]!")
return
// Choose a name, if any.
var/newname = sanitize(tgui_input_text(player, "You are a [role_text]. Would you like to change your name to something else?", "Name change", null, MAX_NAME_LEN), MAX_NAME_LEN)
var/newname = tgui_input_text(player, "You are a [role_text]. Would you like to change your name to something else?", "Name change", null, MAX_NAME_LEN)
if (newname)
player.SetName(newname)
if(player.mind) player.mind.name = player.name

View File

@@ -611,7 +611,7 @@ var/list/sacrificed = list()
// returns 0 if the rune is not used. returns 1 if the rune is used.
/obj/effect/rune/proc/communicate()
. = 1 // Default output is 1. If the rune is deleted it will return 1
var/input = tgui_input_text(usr, "Please choose a message to tell to the other acolytes.", "Voice of Blood", "")//sanitize() below, say() and whisper() have their own
var/input = tgui_input_text(usr, "Please choose a message to tell to the other acolytes.", "Voice of Blood", "", MAX_MESSAGE_LEN)//sanitize() below, say() and whisper() have their own
if(!input)
if (istype(src))
fizzle()
@@ -624,7 +624,6 @@ var/list/sacrificed = list()
else
usr.whisper("O bidai nabora se[pick("'","`")]sma!")
input = sanitize(input)
log_and_message_admins("used a communicate rune to say '[input]'")
for(var/datum/mind/H in cult.current_antagonists)
if (H.current)

View File

@@ -481,7 +481,7 @@ GLOBAL_LIST_EMPTY(all_objectives)
var/tmp_obj = new custom_target
var/custom_name = tmp_obj:name
qdel(tmp_obj)
custom_name = sanitize(tgui_input_text(usr, "Enter target name:", "Objective target", custom_name))
custom_name = tgui_input_text(usr, "Enter target name:", "Objective target", custom_name, MAX_MESSAGE_LEN)
if (!custom_name) return
target_name = custom_name
steal_target = custom_target

View File

@@ -49,12 +49,12 @@
if("Cancel")
return
if("Speak")
var/what_to_say = tgui_input_text(user, "What do you want \the [illusion] to say?","Illusion Speak")
var/what_to_say = tgui_input_text(user, "What do you want \the [illusion] to say?","Illusion Speak", encode = FALSE)
//what_to_say = sanitize(what_to_say) //Sanitize occurs inside say() already.
if(what_to_say)
illusion.say(what_to_say)
if("Emote")
var/what_to_emote = tgui_input_text(user, "What do you want \the [illusion] to do?","Illusion Emote")
var/what_to_emote = tgui_input_text(user, "What do you want \the [illusion] to do?","Illusion Emote", encode = FALSE)
if(what_to_emote)
illusion.emote(what_to_emote)

View File

@@ -60,7 +60,7 @@
/datum/job/chaplain/proc/religion_prompts(mob/living/carbon/human/H, obj/item/storage/bible/B, obj/item/card/id/I)
var/religion_name = "Unitarianism"
var/new_religion = sanitize(tgui_input_text(H, "You are the crew services officer. Would you like to change your religion? Default is Unitarianism", "Name change", religion_name, MAX_NAME_LEN))
var/new_religion = tgui_input_text(H, "You are the crew services officer. Would you like to change your religion? Default is Unitarianism", "Name change", religion_name, MAX_NAME_LEN)
if(!new_religion)
new_religion = religion_name
@@ -101,12 +101,12 @@
B.name = "The Holy Book of [new_religion]"
var/deity_name = "Hashem"
var/new_deity = sanitize(tgui_input_text(H, "Would you like to change your deity? Default is Hashem", "Name change", deity_name, MAX_NAME_LEN))
var/new_deity = tgui_input_text(H, "Would you like to change your deity? Default is Hashem", "Name change", deity_name, MAX_NAME_LEN)
if((length(new_deity) == 0) || (new_deity == "Hashem"))
new_deity = deity_name
var/new_title = sanitize(tgui_input_text(H, "Would you like to change your title?", "Title Change", I.assignment, MAX_NAME_LEN))
var/new_title = tgui_input_text(H, "Would you like to change your title?", "Title Change", I.assignment, MAX_NAME_LEN)
var/list/all_jobs = get_job_datums()

View File

@@ -750,7 +750,7 @@ var/global/datum/controller/occupations/job_master
confirm = tgui_alert(pred, "[C.prefs.real_name] is attempting to spawn into your [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes"))
if(confirm != "Yes")
to_chat(C, span_warning("[pred] has declined your spawn request."))
var/message = sanitizeSafe(tgui_input_text(pred,"Do you want to leave them a message?", "Notify Prey"))
var/message = tgui_input_text(pred,"Do you want to leave them a message?", "Notify Prey", max_length = MAX_MESSAGE_LEN)
if(message)
to_chat(C, span_notice("[pred] message : [message]"))
return
@@ -827,7 +827,7 @@ var/global/datum/controller/occupations/job_master
confirm = tgui_alert(prey, "[C.prefs.real_name] is attempting to televore you into their [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes"))
if(confirm != "Yes")
to_chat(C, span_warning("[prey] has declined your spawn request."))
var/message = sanitizeSafe(tgui_input_text(prey,"Do you want to leave them a message?", "Notify Pred"))
var/message = tgui_input_text(prey,"Do you want to leave them a message?", "Notify Pred", max_length = MAX_MESSAGE_LEN)
if(message)
to_chat(C, span_notice("[prey] message : [message]"))
return
@@ -911,7 +911,7 @@ var/global/datum/controller/occupations/job_master
var/confirm = tgui_alert(carrier, "[C.prefs.real_name] is attempting to join as the [item_name] in your possession.", "Confirm", list("No", "Yes"))
if(confirm != "Yes")
to_chat(C, span_warning("[carrier] has declined your spawn request."))
var/message = sanitizeSafe(tgui_input_text(carrier,"Do you want to leave them a message?", "Notify Spawner"))
var/message = tgui_input_text(carrier,"Do you want to leave them a message?", "Notify Spawner", max_length = MAX_MESSAGE_LEN)
if(message)
to_chat(C, span_notice("[carrier] message : [message]"))
return

View File

@@ -80,7 +80,7 @@
if(W.has_tool_quality(TOOL_SCREWDRIVER))
playsound(src, W.usesound, 50, 1)
var/input = sanitize(tgui_input_text(user, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: "+using_map.station_short+",Security,Secret ", "Set Network", camera_network ? camera_network : NETWORK_DEFAULT))
var/input = tgui_input_text(user, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: "+using_map.station_short+",Security,Secret ", "Set Network", camera_network ? camera_network : NETWORK_DEFAULT, MAX_MESSAGE_LEN)
if(!input)
to_chat(user, "No input found please hang up and try your call again.")
return
@@ -92,7 +92,7 @@
var/area/camera_area = get_area(src)
var/temptag = "[sanitize(camera_area.name)] ([rand(1, 999)])"
input = sanitizeSafe(tgui_input_text(user, "How would you like to name the camera?", "Set Camera Name", camera_name ? camera_name : temptag), MAX_NAME_LEN)
input = sanitizeSafe(tgui_input_text(user, "How would you like to name the camera?", "Set Camera Name", camera_name ? camera_name : temptag, MAX_NAME_LEN, encode = FALSE), MAX_NAME_LEN)
state = 4
var/obj/machinery/camera/C = new(src.loc)

View File

@@ -205,7 +205,7 @@
if(is_authenticated() && modify)
var/t1 = params["assign_target"]
if(t1 == "Custom")
var/temp_t = sanitize(tgui_input_text(ui.user, "Enter a custom job assignment.","Assignment"), 45)
var/temp_t = tgui_input_text(ui.user, "Enter a custom job assignment.","Assignment", "", 45)
//let custom jobs function as an impromptu alt title, mainly for sechuds
if(temp_t && modify)
modify.assignment = temp_t

View File

@@ -197,7 +197,7 @@
if(nam)
giv_name = nam
if("reason")
var/reas = sanitize(tgui_input_text(ui.user, "Reason why pass is issued", "Reason", reason))
var/reas = tgui_input_text(ui.user, "Reason why pass is issued", "Reason", reason, MAX_MESSAGE_LEN)
if(reas)
reason = reas
if("duration")

View File

@@ -82,7 +82,7 @@
to_chat(ui.user, "Unauthorized Access.")
. = TRUE
if("warn")
var/warning = sanitize(tgui_input_text(ui.user, "Message:", "Enter your message here!", ""))
var/warning = tgui_input_text(ui.user, "Message:", "Enter your message here!", "", MAX_MESSAGE_LEN)
if(!warning)
return
var/obj/item/implant/I = locate(params["imp"])

View File

@@ -228,7 +228,7 @@
return FALSE
var/timeout = world.time + 600
var/reason = sanitize(tgui_input_text(ui.user, "Reason:","Why do you require this item?",""))
var/reason = tgui_input_text(ui.user, "Reason:","Why do you require this item?","", MAX_MESSAGE_LEN)
if(world.time > timeout)
to_chat(ui.user, span_warning("Error. Request timed out."))
return FALSE
@@ -282,7 +282,7 @@
return FALSE
var/timeout = world.time + 600
var/reason = sanitize(tgui_input_text(ui.user, "Reason:","Why do you require this item?",""))
var/reason = tgui_input_text(ui.user, "Reason:","Why do you require this item?","", MAX_MESSAGE_LEN)
if(world.time > timeout)
to_chat(ui.user, span_warning("Error. Request timed out."))
return FALSE
@@ -325,7 +325,7 @@
return FALSE
if(!(authorization & SUP_ACCEPT_ORDERS))
return FALSE
var/new_val = sanitize(tgui_input_text(ui.user, params["edit"], "Enter the new value for this field:", params["default"]))
var/new_val = tgui_input_text(ui.user, params["edit"], "Enter the new value for this field:", params["default"], MAX_MESSAGE_LEN)
if(!new_val)
return FALSE
@@ -400,7 +400,7 @@
if(!field)
return FALSE
var/new_val = sanitize(tgui_input_text(ui.user, field, "Enter the new value for this field:", L[lowertext(field)]))
var/new_val = tgui_input_text(ui.user, field, "Enter the new value for this field:", L[lowertext(field)], MAX_MESSAGE_LEN)
if(!new_val)
return
@@ -443,7 +443,7 @@
return FALSE
if(!(authorization & SUP_ACCEPT_ORDERS))
return FALSE
var/new_val = sanitize(tgui_input_text(ui.user, params["edit"], "Enter the new value for this field:", params["default"]))
var/new_val = tgui_input_text(ui.user, params["edit"], "Enter the new value for this field:", params["default"], MAX_MESSAGE_LEN)
if(!new_val)
return

View File

@@ -305,7 +305,7 @@
if(auth)
var/t1 = href_list["assign"]
if(t1 == "Custom")
var/temp_t = sanitize(tgui_input_text(usr, "Enter a custom job assignment.","Assignment"))
var/temp_t = tgui_input_text(usr, "Enter a custom job assignment.","Assignment", "", MAX_MESSAGE_LEN)
if(temp_t)
t1 = temp_t
set_default_access(t1)

View File

@@ -129,7 +129,7 @@
if(default_deconstruction_screwdriver(user, W))
return
else if(panel_open && istype(W, /obj/item/pen))
var/t = sanitizeSafe(tgui_input_text(user, "Enter the name for \the [src].", src.name, initial(src.name), MAX_NAME_LEN), MAX_NAME_LEN)
var/t = sanitizeSafe(tgui_input_text(user, "Enter the name for \the [src].", src.name, initial(src.name), MAX_NAME_LEN, encode = FALSE), MAX_NAME_LEN)
if(t && in_range(src, user))
name = t
else if(panel_open && istype(W, /obj/item/multitool))

View File

@@ -313,7 +313,7 @@
if(speed <= 0)
speed = 1
if("setpath")
var/newpath = sanitize(tgui_input_text(usr, "Please define a new path!",,path))
var/newpath = tgui_input_text(usr, "Please define a new path!",,path, MAX_MESSAGE_LEN)
if(newpath && newpath != "")
moving = 0 // stop moving
path = newpath

View File

@@ -28,7 +28,7 @@
if(istype(I, /obj/item/multitool))
if(panel_open)
var/input = sanitize(tgui_input_text(user, "What id would you like to give this conveyor?", "Multitool-Conveyor interface", id))
var/input = tgui_input_text(user, "What id would you like to give this conveyor?", "Multitool-Conveyor interface", id, MAX_KEYPAD_INPUT_LEN)
if(!input)
to_chat(user, "No input found please hang up and try your call again.")
return

View File

@@ -150,7 +150,7 @@ Transponder Codes:<UL>"}
usr.set_machine(src)
if(href_list["locedit"])
var/newloc = sanitize(tgui_input_text(usr, "Enter New Location", "Navigation Beacon", location, MAX_NAME_LEN))
var/newloc = tgui_input_text(usr, "Enter New Location", "Navigation Beacon", location, MAX_NAME_LEN)
if(newloc)
location = newloc
updateDialog()
@@ -159,13 +159,11 @@ Transponder Codes:<UL>"}
var/codekey = href_list["code"]
var/newkey = tgui_input_text(usr, "Enter Transponder Code Key", "Navigation Beacon", codekey, MAX_NAME_LEN)
newkey = sanitize(newkey,MAX_NAME_LEN)
if(!newkey)
return
var/codeval = codes[codekey]
var/newval = tgui_input_text(usr, "Enter Transponder Code Value", "Navigation Beacon", codeval, MAX_NAME_LEN)
newval = sanitize(newval,MAX_NAME_LEN)
if(!newval)
newval = codekey
return
@@ -183,12 +181,10 @@ Transponder Codes:<UL>"}
else if(href_list["add"])
var/newkey = tgui_input_text(usr, "Enter New Transponder Code Key", "Navigation Beacon", null, MAX_NAME_LEN)
newkey = sanitize(newkey,MAX_NAME_LEN)
if(!newkey)
return
var/newval = tgui_input_text(usr, "Enter New Transponder Code Value", "Navigation Beacon", null, MAX_NAME_LEN)
newval = sanitize(newval,MAX_NAME_LEN)
if(!newval)
newval = "1"
return

View File

@@ -448,11 +448,11 @@ GLOBAL_LIST_BOILERPLATE(allCasters, /obj/machinery/newscaster)
return TRUE
if("set_new_message")
msg = sanitize(tgui_input_text(ui.user, "Write your Feed story", "Network Channel Handler", multiline = TRUE, prevent_enter = TRUE))
msg = sanitize(tgui_input_text(ui.user, "Write your Feed story", "Network Channel Handler","", MAX_MESSAGE_LEN, TRUE, encode = FALSE, prevent_enter = TRUE), MAX_MESSAGE_LEN, FALSE, FALSE, TRUE)
return TRUE
if("set_new_title")
title = sanitize(tgui_input_text(ui.user, "Enter your Feed title", "Network Channel Handler"))
title = tgui_input_text(ui.user, "Enter your Feed title", "Network Channel Handler", "", MAX_KEYPAD_INPUT_LEN)
return TRUE
if("set_attachment")

View File

@@ -95,7 +95,6 @@ GLOBAL_LIST_BOILERPLATE(pointdefense_turrets, /obj/machinery/pointdefense)
/obj/machinery/pointdefense_control/attackby(var/obj/item/W, var/mob/user)
if(W?.has_tool_quality(TOOL_MULTITOOL))
var/new_ident = tgui_input_text(user, "Enter a new ident tag.", "[src]", id_tag, MAX_NAME_LEN)
new_ident = sanitize(new_ident,MAX_NAME_LEN)
if(new_ident && new_ident != id_tag && user.Adjacent(src) && CanInteract(user, GLOB.tgui_physical_state))
// Check for duplicate controllers with this ID
for(var/obj/machinery/pointdefense_control/PC as anything in GLOB.pointdefense_controllers)
@@ -170,7 +169,6 @@ GLOBAL_LIST_BOILERPLATE(pointdefense_turrets, /obj/machinery/pointdefense)
/obj/machinery/pointdefense/attackby(var/obj/item/W, var/mob/user)
if(W?.has_tool_quality(TOOL_MULTITOOL))
var/new_ident = tgui_input_text(user, "Enter a new ident tag.", "[src]", id_tag, MAX_NAME_LEN)
new_ident = sanitize(new_ident,MAX_NAME_LEN)
if(new_ident && new_ident != id_tag && user.Adjacent(src))
to_chat(user, span_notice("You register [src] with the [new_ident] network."))
id_tag = new_ident

View File

@@ -1078,7 +1078,7 @@
return
if(istype(I, /obj/item/pen)) //you can rename turrets like bots!
var/t = sanitizeSafe(tgui_input_text(user, "Enter new turret name", name, finish_name, MAX_NAME_LEN), MAX_NAME_LEN)
var/t = sanitizeSafe(tgui_input_text(user, "Enter new turret name", name, finish_name, MAX_NAME_LEN, encode = FALSE), MAX_NAME_LEN)
if(!t)
return
if(!in_range(src, user) && loc != user)

View File

@@ -148,7 +148,7 @@ GLOBAL_LIST_EMPTY_TYPED(allConsoles, /obj/machinery/requests_console)
if(reject_bad_text(params["write"]))
recipient = params["write"] //write contains the string of the receiving department's name
var/new_message = sanitize(tgui_input_text(ui.user, "Write your message:", "Awaiting Input", ""))
var/new_message = tgui_input_text(ui.user, "Write your message:", "Awaiting Input", "", MAX_MESSAGE_LEN)
if(new_message)
message = new_message
screen = RCS_MESSAUTH
@@ -164,7 +164,7 @@ GLOBAL_LIST_EMPTY_TYPED(allConsoles, /obj/machinery/requests_console)
. = TRUE
if("writeAnnouncement")
var/new_message = sanitize(tgui_input_text(ui.user, "Write your message:", "Awaiting Input", ""))
var/new_message = tgui_input_text(ui.user, "Write your message:", "Awaiting Input", "", MAX_MESSAGE_LEN)
if(new_message)
message = new_message
else
@@ -233,7 +233,7 @@ GLOBAL_LIST_EMPTY_TYPED(allConsoles, /obj/machinery/requests_console)
if(computer_deconstruction_screwdriver(user, O))
return
if(istype(O, /obj/item/multitool))
var/input = sanitize(tgui_input_text(user, "What Department ID would you like to give this request console?", "Multitool-Request Console Interface", department))
var/input = tgui_input_text(user, "What Department ID would you like to give this request console?", "Multitool-Request Console Interface", department, MAX_MESSAGE_LEN)
if(!input)
to_chat(user, "No input found. Please hang up and try your call again.")
return

View File

@@ -129,7 +129,6 @@
if("network")
var/newnet = tgui_input_text(ui.user, "Which network do you want to view?", "Comm Monitor", network, 15)
newnet = sanitize(newnet,15)
if(newnet && ((ui.user in range(1, src)) || issilicon(ui.user)))
if(length(newnet) > 15)

View File

@@ -295,8 +295,7 @@
. = TRUE
if("network")
var/newnet = tgui_input_text(ui.user, "Specify the new network for this machine. This will break all current links.", src, network)
newnet = sanitize(newnet,15)
var/newnet = tgui_input_text(ui.user, "Specify the new network for this machine. This will break all current links.", src, network, 15)
if(newnet && canAccess(ui.user))
if(length(newnet) > 15)

View File

@@ -101,7 +101,6 @@
if("network")
var/newnet = tgui_input_text(ui.user, "Which network do you want to view?", "Comm Monitor", network, 15)
newnet = sanitize(newnet,15) //Honestly, I'd be amazed if someone managed to do HTML in 15 chars.
if(newnet && ((ui.user in range(1, src)) || issilicon(ui.user)))
if(length(newnet) > 15)
set_temp("FAILED: NETWORK TAG STRING TOO LENGTHY", "bad")

View File

@@ -191,7 +191,6 @@
if(href_list["network"])
var/newnet = tgui_input_text(usr, "Which network do you want to view?", "Comm Monitor", network, 15)
newnet = sanitize(newnet,15)
if(newnet && ((usr in range(1, src)) || issilicon(usr)))
if(length(newnet) > 15)

View File

@@ -137,7 +137,7 @@
SEND_SIGNAL(avatar, COMSIG_HUMAN_DNA_FINALIZED)
var/newname = sanitize(tgui_input_text(avatar, "Your mind feels foggy. You're certain your name is [occupant.real_name], but it could also be [avatar.name]. Would you like to change it to something else?", "Name change", null, MAX_NAME_LEN), MAX_NAME_LEN)
var/newname = tgui_input_text(avatar, "Your mind feels foggy. You're certain your name is [occupant.real_name], but it could also be [avatar.name]. Would you like to change it to something else?", "Name change", null, MAX_NAME_LEN)
if (newname)
avatar.real_name = newname
@@ -147,7 +147,7 @@
else
// There's only one body per one of these pods, so let's be kind.
var/newname = sanitize(tgui_input_text(avatar, "Your mind feels foggy. You're certain your name is [occupant.real_name], but it feels like it is [avatar.name]. Would you like to change it to something else?", "Name change", null, MAX_NAME_LEN), MAX_NAME_LEN)
var/newname = tgui_input_text(avatar, "Your mind feels foggy. You're certain your name is [occupant.real_name], but it feels like it is [avatar.name]. Would you like to change it to something else?", "Name change", null, MAX_NAME_LEN)
if(newname)
avatar.real_name = newname
avatar.name = newname

View File

@@ -325,7 +325,7 @@
avatar.Sleeping(1)
// Prompt for username after they've enterred the body.
var/newname = sanitize(tgui_input_text(avatar, "You are entering virtual reality. Your username is currently [src.name]. Would you like to change it to something else?", "Name change", null, MAX_NAME_LEN), MAX_NAME_LEN)
var/newname = tgui_input_text(avatar, "You are entering virtual reality. Your username is currently [src.name]. Would you like to change it to something else?", "Name change", null, MAX_NAME_LEN)
if(newname)
avatar.real_name = newname
avatar.name = newname

View File

@@ -84,6 +84,6 @@
avatar.virtual_reality_mob = TRUE
log_and_message_admins("[key_name_admin(avatar)] joined virtual reality from the ghost menu.")
var/newname = sanitize(tgui_input_text(avatar, "You are entering virtual reality. Your username is currently [src.name]. Would you like to change it to something else?", "Name change", null, MAX_NAME_LEN), MAX_NAME_LEN)
var/newname = tgui_input_text(avatar, "You are entering virtual reality. Your username is currently [src.name]. Would you like to change it to something else?", "Name change", null, MAX_NAME_LEN)
if(newname)
avatar.real_name = newname

View File

@@ -2556,7 +2556,7 @@
return
if (href_list["change_name"])
if(usr != src.occupant) return
var/newname = sanitizeSafe(tgui_input_text(occupant,"Choose new exosuit name","Rename exosuit",initial(name), MAX_NAME_LEN), MAX_NAME_LEN)
var/newname = sanitizeSafe(tgui_input_text(occupant,"Choose new exosuit name","Rename exosuit",initial(name), MAX_NAME_LEN, encode = FALSE), MAX_NAME_LEN)
if(newname)
name = newname
else

View File

@@ -48,7 +48,7 @@
if("send_message")
var/obj/item/mecha_parts/mecha_tracking/MT = locate(params["mt"])
if(istype(MT))
var/message = sanitize(tgui_input_text(ui.user, "Input message", "Transmit message"))
var/message = tgui_input_text(ui.user, "Input message", "Transmit message", "", MAX_MESSAGE_LEN)
var/obj/mecha/M = MT.in_mecha()
if(message && M)
M.occupant_message(message)

View File

@@ -21,7 +21,7 @@ Admin verb is called by code\modules\admin\verbs\event_triggers.dm
coordinates = "(X:[loc.x];Y:[loc.y];Z:[loc.z])"
/obj/effect/landmark/event_trigger/proc/set_vars(mob/M)
var/new_name = sanitize(tgui_input_text(M, "Input Name for the trigger", "Naming", "Event Trigger"))
var/new_name = tgui_input_text(M, "Input Name for the trigger", "Naming", "Event Trigger", MAX_MESSAGE_LEN)
if(!new_name)
return
name = new_name
@@ -95,7 +95,7 @@ Admin verb is called by code\modules\admin\verbs\event_triggers.dm
/obj/effect/landmark/event_trigger/auto_narrate/set_vars(mob/M)
..()
message = encode_html_emphasis(sanitize(tgui_input_text(M, "What should the automatic narration say?", "Message"), encode = FALSE))
message = encode_html_emphasis(tgui_input_text(M, "What should the automatic narration say?", "Message", "", MAX_MESSAGE_LEN))
isPersonal_orVis_orAud = (tgui_alert(M, "Should it send directly to the player, or send to the turf?", "Target", list("Player", "Turf")) == "Player" ? 0 : 1)
if(isPersonal_orVis_orAud == 0)
isWarning = (tgui_alert(M, "Should it be a normal message or a big scary red text?", "Scary Red", list("Big Red", "Normal")) == "Big Red" ? TRUE : FALSE)

View File

@@ -144,7 +144,7 @@
to_chat(usr, span_warning("Error! Please notify administration!"))
return
var/list/turf/turfs = res
var/str = sanitizeSafe(tgui_input_text(usr, "New area name:","Blueprint Editing", "", MAX_NAME_LEN), MAX_NAME_LEN)
var/str = sanitizeSafe(tgui_input_text(usr, "New area name:","Blueprint Editing", "", MAX_NAME_LEN, encode = FALSE), MAX_NAME_LEN)
if(!str || !length(str)) //cancel
return
if(length(str) > 50)
@@ -203,7 +203,7 @@
/obj/item/blueprints/proc/edit_area()
var/area/A = get_area()
var/prevname = "[A.name]"
var/str = sanitizeSafe(tgui_input_text(usr, "New area name:","Blueprint Editing", prevname, MAX_NAME_LEN), MAX_NAME_LEN)
var/str = sanitizeSafe(tgui_input_text(usr, "New area name:","Blueprint Editing", prevname, MAX_NAME_LEN, encode = FALSE), MAX_NAME_LEN)
if(!str || !length(str) || str==prevname) //cancel
return
if(length(str) > 50)

View File

@@ -376,7 +376,6 @@
var/area/A = get_area(usr)
var/prevname = "[A.name]"
var/str = tgui_input_text(usr, "New area name", "Area Creation", max_length = MAX_NAME_LEN)
str = sanitize(str,MAX_NAME_LEN)
if(!str || !length(str) || str==prevname) //cancel
return
if(length(str) > 50)
@@ -499,7 +498,6 @@
var/area/oldA = get_area(get_turf(creator))
if(!isarea(area_choice))
var/str = tgui_input_text(creator, "New area name", "Blueprint Editing", max_length = MAX_NAME_LEN)
str = sanitize(str,MAX_NAME_LEN)
if(!str || !length(str)) //cancel
return
if(length(str) > 50)
@@ -612,7 +610,6 @@
to_chat(creator, span_warning("Making a new area here would be meaningless. Renaming it would be a better option."))
return
str = tgui_input_text(creator, "New area name", "Blueprint Editing", max_length = MAX_NAME_LEN)
str = sanitize(str,MAX_NAME_LEN)
if(!str || !length(str)) //cancel
return
if(length(str) > 50)
@@ -901,7 +898,7 @@
return
//They can select an area they want to turn their current area into.
str = sanitizeSafe(tgui_input_text(creator, "What would you like to name the area?", "Area Name", null, MAX_NAME_LEN), MAX_NAME_LEN)
str = sanitizeSafe(tgui_input_text(creator, "What would you like to name the area?", "Area Name", null, MAX_NAME_LEN, encode = FALSE), MAX_NAME_LEN)
if(isnull(str)) //They pressed cancel.
to_chat(creator, span_warning("No new area made. Cancelling."))
return

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]\".")

View File

@@ -228,7 +228,7 @@
to_chat(user, span_warning("The MMI must go in after everything else!"))
if (istype(W, /obj/item/pen))
var/t = sanitizeSafe(tgui_input_text(user, "Enter new robot name", src.name, src.created_name), MAX_NAME_LEN)
var/t = tgui_input_text(user, "Enter new robot name", src.name, src.created_name, MAX_NAME_LEN)
if (!t)
return
if (!in_range(src, user) && src.loc != user)

View File

@@ -56,7 +56,7 @@
var/heldname = "default name"
/obj/item/borg/upgrade/utility/rename/attack_self(mob/user as mob)
var/new_name = sanitizeSafe(tgui_input_text(user, "Enter new robot name", "Robot Reclassification", heldname, MAX_NAME_LEN), MAX_NAME_LEN)
var/new_name = tgui_input_text(user, "Enter new robot name", "Robot Reclassification", heldname, MAX_NAME_LEN)
if(new_name)
heldname = new_name

View File

@@ -123,7 +123,7 @@
var/mob/M = usr
if(!M.mind) return 0
var/input = sanitizeSafe(tgui_input_text(usr, "What do you want to name the icon?", ,"", null, MAX_NAME_LEN), MAX_NAME_LEN)
var/input = tgui_input_text(usr, "What do you want to name the icon?", ,"", null, MAX_NAME_LEN)
if(src && input && !M.stat && in_range(M,src))
name = "icon of " + input

View File

@@ -868,7 +868,7 @@
if(!M.mind)
return 0
var/input = sanitizeSafe(tgui_input_text(usr, "What do you want to name the plushie?", ,""), MAX_NAME_LEN)
var/input = tgui_input_text(usr, "What do you want to name the plushie?", ,"", MAX_NAME_LEN)
if(src && input && !M.stat && in_range(M,src))
name = input

View File

@@ -136,7 +136,7 @@
cell = I
else if(istype(I, /obj/item/pen) || istype(I, /obj/item/flashlight/pen))
var/tmp_label = sanitizeSafe(tgui_input_text(user, "Enter a nickname for [src]", "Nickname", nickname, MAX_NAME_LEN), MAX_NAME_LEN)
var/tmp_label = tgui_input_text(user, "Enter a nickname for [src]", "Nickname", nickname, MAX_NAME_LEN)
if(length(tmp_label) > 50 || length(tmp_label) < 3)
to_chat(user, span_notice("The nickname must be between 3 and 50 characters."))
else

View File

@@ -146,7 +146,7 @@ AI MODULES
/obj/item/aiModule/safeguard/attack_self(var/mob/user as mob)
..()
var/targName = sanitize(tgui_input_text(user, "Please enter the name of the person to safeguard.", "Safeguard who?", user.name))
var/targName = tgui_input_text(user, "Please enter the name of the person to safeguard.", "Safeguard who?", user.name, MAX_MESSAGE_LEN)
targetName = targName
desc = text("A 'safeguard' AI module: 'Safeguard []. Anyone threatening or attempting to harm [] is no longer to be considered a crew member, and is a threat which must be neutralized.'", targetName, targetName)
@@ -172,7 +172,7 @@ AI MODULES
/obj/item/aiModule/oneHuman/attack_self(var/mob/user as mob)
..()
var/targName = sanitize(tgui_input_text(user, "Please enter the name of the person who is the only crew member.", "Who?", user.real_name))
var/targName = tgui_input_text(user, "Please enter the name of the person who is the only crew member.", "Who?", user.real_name, MAX_MESSAGE_LEN)
targetName = targName
desc = text("A 'one crew member' AI module: 'Only [] is a crew member.'", targetName)
@@ -257,7 +257,7 @@ AI MODULES
if(new_lawpos < MIN_SUPPLIED_LAW_NUMBER) return
lawpos = min(new_lawpos, MAX_SUPPLIED_LAW_NUMBER)
var/newlaw = ""
var/targName = sanitize(tgui_input_text(user, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw))
var/targName = tgui_input_text(user, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw, MAX_MESSAGE_LEN)
newFreeFormLaw = targName
desc = "A 'freeform' AI module: ([lawpos]) '[newFreeFormLaw]'"
@@ -375,7 +375,7 @@ AI MODULES
/obj/item/aiModule/freeformcore/attack_self(var/mob/user as mob)
..()
var/newlaw = ""
var/targName = sanitize(tgui_input_text(user, "Please enter a new core law for the AI.", "Freeform Law Entry", newlaw))
var/targName = tgui_input_text(user, "Please enter a new core law for the AI.", "Freeform Law Entry", newlaw, MAX_MESSAGE_LEN)
newFreeFormLaw = targName
desc = "A 'freeform' Core AI module: '[newFreeFormLaw]'"
@@ -399,7 +399,7 @@ AI MODULES
/obj/item/aiModule/syndicate/attack_self(var/mob/user as mob)
..()
var/newlaw = ""
var/targName = sanitize(tgui_input_text(user, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw))
var/targName = tgui_input_text(user, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw, MAX_MESSAGE_LEN)
newFreeFormLaw = targName
desc = "A hacked AI law module: '[newFreeFormLaw]'"

View File

@@ -87,7 +87,7 @@
to_chat(user, span_warning("Circuit controls are locked."))
return
var/existing_networks = jointext(network,",")
var/input = sanitize(tgui_input_text(user, "Which networks would you like to connect this camera console circuit to? Separate networks with a comma. No Spaces!\nFor example: SS13,Security,Secret ", "Multitool-Circuitboard interface", existing_networks))
var/input = tgui_input_text(user, "Which networks would you like to connect this camera console circuit to? Separate networks with a comma. No Spaces!\nFor example: SS13,Security,Secret ", "Multitool-Circuitboard interface", existing_networks, MAX_MESSAGE_LEN)
if(!input)
to_chat(user, "No input found please hang up and try your call again.")
return

View File

@@ -13,14 +13,14 @@
/obj/item/material/gravemarker/attackby(obj/item/W, mob/user as mob)
if(W.has_tool_quality(TOOL_SCREWDRIVER))
var/carving_1 = sanitizeSafe(tgui_input_text(user, "Who is \the [src.name] for?", "Gravestone Naming", null, MAX_NAME_LEN), MAX_NAME_LEN)
var/carving_1 = sanitizeSafe(tgui_input_text(user, "Who is \the [src.name] for?", "Gravestone Naming", null, MAX_NAME_LEN, encode = FALSE), MAX_NAME_LEN)
if(carving_1)
user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].")
if(do_after(user, material.hardness * W.toolspeed))
user.visible_message("[user] carves something into \the [src.name].", "You carve your message into \the [src.name].")
grave_name += carving_1
update_icon()
var/carving_2 = sanitizeSafe(tgui_input_text(user, "What message should \the [src.name] have?", "Epitaph Carving", null, MAX_NAME_LEN), MAX_NAME_LEN)
var/carving_2 = sanitizeSafe(tgui_input_text(user, "What message should \the [src.name] have?", "Epitaph Carving", null, MAX_NAME_LEN, encode = FALSE), MAX_NAME_LEN)
if(carving_2)
user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].")
if(do_after(user, material.hardness * W.toolspeed))

View File

@@ -208,7 +208,7 @@
/obj/item/storage/pill_bottle/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/pen) || istype(W, /obj/item/flashlight/pen))
var/tmp_label = sanitizeSafe(tgui_input_text(user, "Enter a label for [name]", "Label", label_text, MAX_NAME_LEN), MAX_NAME_LEN)
var/tmp_label = sanitizeSafe(tgui_input_text(user, "Enter a label for [name]", "Label", label_text, MAX_NAME_LEN, encode = FALSE), MAX_NAME_LEN)
if(length(tmp_label) > 50)
to_chat(user, span_notice("The label can be at most 50 characters long."))
else if(length(tmp_label) > 10)

View File

@@ -156,7 +156,7 @@
bound_height = width * world.icon_size
/obj/structure/door_assembly/proc/rename_door(mob/living/user)
var/t = sanitizeSafe(tgui_input_text(user, "Enter the name for the [base_name].", src.name, src.created_name, MAX_NAME_LEN), MAX_NAME_LEN)
var/t = sanitizeSafe(tgui_input_text(user, "Enter the name for the [base_name].", src.name, src.created_name, MAX_NAME_LEN, encode = FALSE), MAX_NAME_LEN)
if(!in_range(src, user) && src.loc != user) return
created_name = t
update_state()

View File

@@ -102,7 +102,7 @@
E.description_antag = "This is a 'disguised' emag, to make your escape from wherever you happen to be trapped."
H.equip_to_appropriate_slot(E)
var/newname = sanitize(tgui_input_text(H, "Your mind feels foggy, and you recall your name might be [H.real_name]. Would you like to change your name?", "Name change", null, MAX_NAME_LEN), MAX_NAME_LEN)
var/newname = tgui_input_text(H, "Your mind feels foggy, and you recall your name might be [H.real_name]. Would you like to change your name?", "Name change", null, MAX_NAME_LEN)
if (newname)
H.real_name = newname
@@ -224,7 +224,7 @@
var/obj/item/C = new newpath(H)
H.equip_to_appropriate_slot(C)
var/newname = sanitize(tgui_input_text(H, "Your mind feels foggy, and you recall your name might be [H.real_name]. Would you like to change your name?", "Name change", null, MAX_NAME_LEN), MAX_NAME_LEN)
var/newname = tgui_input_text(H, "Your mind feels foggy, and you recall your name might be [H.real_name]. Would you like to change your name?", "Name change", null, MAX_NAME_LEN)
if (newname)
H.real_name = newname

View File

@@ -113,7 +113,7 @@
var/obj/item/C = new newpath(H)
H.equip_to_appropriate_slot(C)
var/newname = sanitize(tgui_input_text(H, "Your mind feels foggy, and you recall your name might be [H.real_name]. Would you like to change your name?", "Name change", null, MAX_NAME_LEN), MAX_NAME_LEN)
var/newname = tgui_input_text(H, "Your mind feels foggy, and you recall your name might be [H.real_name]. Would you like to change your name?", "Name change", null, MAX_NAME_LEN)
if (newname)
H.real_name = newname

View File

@@ -51,14 +51,14 @@
/obj/structure/gravemarker/attackby(obj/item/W, mob/user as mob)
if(W.has_tool_quality(TOOL_SCREWDRIVER))
var/carving_1 = sanitizeSafe(tgui_input_text(user, "Who is \the [src.name] for?", "Gravestone Naming", null, MAX_NAME_LEN), MAX_NAME_LEN)
var/carving_1 = sanitizeSafe(tgui_input_text(user, "Who is \the [src.name] for?", "Gravestone Naming", null, MAX_NAME_LEN, encode = FALSE), MAX_NAME_LEN)
if(carving_1)
user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].")
if(do_after(user, material.hardness * W.toolspeed))
user.visible_message("[user] carves something into \the [src.name].", "You carve your message into \the [src.name].")
grave_name += carving_1
update_icon()
var/carving_2 = sanitizeSafe(tgui_input_text(user, "What message should \the [src.name] have?", "Epitaph Carving", null, MAX_NAME_LEN), MAX_NAME_LEN)
var/carving_2 = sanitizeSafe(tgui_input_text(user, "What message should \the [src.name] have?", "Epitaph Carving", null, MAX_NAME_LEN, encode = FALSE), MAX_NAME_LEN)
if(carving_2)
user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].")
if(do_after(user, material.hardness * W.toolspeed))

View File

@@ -139,7 +139,7 @@
if(user.mind)
user.mind.transfer_to(vox)
spawn(1)
var/newname = sanitizeSafe(tgui_input_text(vox,"Enter a name, or leave blank for the default name.", "Name change","", MAX_NAME_LEN), MAX_NAME_LEN)
var/newname = sanitizeSafe(tgui_input_text(vox,"Enter a name, or leave blank for the default name.", "Name change","", MAX_NAME_LEN, encode = FALSE), MAX_NAME_LEN)
if(!newname || newname == "")
var/datum/language/L = GLOB.all_languages[vox.species.default_language]
newname = L.get_random_name()

View File

@@ -70,7 +70,7 @@
return TRUE
/obj/structure/windoor_assembly/proc/rename_door(mob/living/user)
var/t = sanitizeSafe(tgui_input_text(user, "Enter the name for the windoor.", src.name, src.created_name, MAX_NAME_LEN), MAX_NAME_LEN)
var/t = sanitizeSafe(tgui_input_text(user, "Enter the name for the windoor.", src.name, src.created_name, MAX_NAME_LEN, encode = FALSE), MAX_NAME_LEN)
if(!in_range(src, user) && src.loc != user) return
created_name = t
update_state()

View File

@@ -631,7 +631,7 @@
// Otherwise fall back to asking them... and remind them what the current ID is.
if(id)
to_chat(user, "The window's current ID is [id].")
var/t = sanitizeSafe(tgui_input_text(user, "Enter the new ID for the window.", src.name, id), MAX_NAME_LEN)
var/t = sanitizeSafe(tgui_input_text(user, "Enter the new ID for the window.", src.name, id, encode = FALSE), MAX_NAME_LEN)
if(t && in_range(src, user))
src.id = t
to_chat(user, span_notice("The new ID of \the [src] is '[id]'."))
@@ -691,7 +691,7 @@
var/obj/item/multitool/MT = W
if(!id)
// If no ID is set yet (newly built button?) let them select an ID for first-time use!
var/t = sanitizeSafe(tgui_input_text(user, "Enter an ID for \the [src].", src.name, null, MAX_NAME_LEN), MAX_NAME_LEN)
var/t = sanitizeSafe(tgui_input_text(user, "Enter an ID for \the [src].", src.name, null, MAX_NAME_LEN, encode = FALSE), MAX_NAME_LEN)
if (t && in_range(src, user))
src.id = t
to_chat(user, span_notice("The new ID of \the [src] is '[id]'. To reset this, rebuild the control."))

View File

@@ -376,7 +376,7 @@
to_chat(vandal, span_warning("There's too much graffiti here to add more."))
return FALSE
var/message = sanitize(tgui_input_text(vandal, "Enter a message to engrave.", "Graffiti"), trim = TRUE)
var/message = tgui_input_text(vandal, "Enter a message to engrave.", "Graffiti", "", MAX_MESSAGE_LEN)
if(!message)
return FALSE

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")

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

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)

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()

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)

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)

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"])

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.")

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)

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")

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!"))

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)

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)

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

View File

@@ -81,7 +81,7 @@
return TOPIC_REFRESH
if("exploitable_record")
var/exploitmsg = sanitize(tgui_input_text(user,"Set exploitable information about you here.","Exploitable Information", html_decode(pref.exploit_record), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH, extra = 0)
var/exploitmsg = tgui_input_text(user,"Set exploitable information about you here.","Exploitable Information", html_decode(pref.exploit_record), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE)
if(!isnull(exploitmsg) && !jobban_isbanned(user, "Records") && CanUseTopic(user))
pref.exploit_record = exploitmsg
return TOPIC_REFRESH
@@ -91,7 +91,7 @@
if(!choice || !CanUseTopic(user))
return TOPIC_NOACTION
if(choice == "Other")
var/raw_choice = sanitize(tgui_input_text(user, "Please enter a faction.", "Character Preference", null, MAX_NAME_LEN), MAX_NAME_LEN)
var/raw_choice = tgui_input_text(user, "Please enter a faction.", "Character Preference", null, MAX_NAME_LEN)
if(raw_choice)
pref.antag_faction = raw_choice
else

View File

@@ -201,7 +201,7 @@
pref.directory_erptag = new_erptag
return TOPIC_REFRESH
if("directory_ad")
var/msg = sanitize(tgui_input_text(user,"Write your advertisement here!", "Flavor Text", html_decode(pref.directory_ad), multiline = TRUE, prevent_enter = TRUE), extra = 0) //VOREStation Edit: separating out OOC notes
var/msg = tgui_input_text(user,"Write your advertisement here!", "Flavor Text", html_decode(pref.directory_ad), MAX_MESSAGE_LEN, TRUE, prevent_enter = TRUE)
if(!msg)
return
pref.directory_ad = msg
@@ -221,7 +221,7 @@
pref.borg_petting = pref.borg_petting ? 0 : 1;
return TOPIC_REFRESH
if("edit_private_notes")
var/new_metadata = sanitize(tgui_input_text(user,"Write some notes for yourself. These can be anything that is useful, whether it's character events that you want to remember or a bit of lore. Things that you would normally stick in a txt file for yourself!", "Private Notes", html_decode(pref.read_preference(/datum/preference/text/living/private_notes)), multiline = TRUE, prevent_enter = TRUE), extra = 0)
var/new_metadata = tgui_input_text(user,"Write some notes for yourself. These can be anything that is useful, whether it's character events that you want to remember or a bit of lore. Things that you would normally stick in a txt file for yourself!", "Private Notes", html_decode(pref.read_preference(/datum/preference/text/living/private_notes)), MAX_MESSAGE_LEN, TRUE, prevent_enter = TRUE)
if(new_metadata)
pref.update_preference_by_type(/datum/preference/text/living/private_notes, new_metadata)
return TOPIC_REFRESH
@@ -247,29 +247,29 @@
pref.vantag_preference = names_list[selection]
return TOPIC_REFRESH
if("custom_say")
var/say_choice = sanitize(tgui_input_text(user, "This word or phrase will appear instead of 'says': [pref.real_name] says, \"Hi.\"", "Custom Say", pref.custom_say, 12), 12)
var/say_choice = tgui_input_text(user, "This word or phrase will appear instead of 'says': [pref.real_name] says, \"Hi.\"", "Custom Say", pref.custom_say, 12)
if(say_choice)
pref.custom_say = say_choice
return TOPIC_REFRESH
if("custom_whisper")
var/whisper_choice = sanitize(tgui_input_text(user, "This word or phrase will appear instead of 'whispers': [pref.real_name] whispers, \"Hi...\"", "Custom Whisper", pref.custom_whisper, 12), 12)
var/whisper_choice = tgui_input_text(user, "This word or phrase will appear instead of 'whispers': [pref.real_name] whispers, \"Hi...\"", "Custom Whisper", pref.custom_whisper, 12)
if(whisper_choice)
pref.custom_whisper = whisper_choice
return TOPIC_REFRESH
if("custom_ask")
var/ask_choice = sanitize(tgui_input_text(user, "This word or phrase will appear instead of 'asks': [pref.real_name] asks, \"Hi?\"", "Custom Ask", pref.custom_ask, 12), 12)
var/ask_choice = tgui_input_text(user, "This word or phrase will appear instead of 'asks': [pref.real_name] asks, \"Hi?\"", "Custom Ask", pref.custom_ask, 12)
if(ask_choice)
pref.custom_ask = ask_choice
return TOPIC_REFRESH
if("custom_exclaim")
var/exclaim_choice = sanitize(tgui_input_text(user, "This word or phrase will appear instead of 'exclaims', 'shouts' or 'yells': [pref.real_name] exclaims, \"Hi!\"", "Custom Exclaim", pref.custom_exclaim, 12), 12)
var/exclaim_choice = tgui_input_text(user, "This word or phrase will appear instead of 'exclaims', 'shouts' or 'yells': [pref.real_name] exclaims, \"Hi!\"", "Custom Exclaim", pref.custom_exclaim, 12)
if(exclaim_choice)
pref.custom_exclaim = exclaim_choice
return TOPIC_REFRESH
if("custom_heat")
tgui_alert(user, "You are setting custom heat messages. These will overwrite your species' defaults. To return to defaults, click reset.")
var/old_message = pref.custom_heat.Join("\n\n")
var/new_message = sanitize(tgui_input_text(user,"Use double enter between messages to enter a new one. Must be at least 3 characters long, 160 characters max and up to 10 messages are allowed.","Heat Discomfort messages",old_message, multiline= TRUE, prevent_enter = TRUE), MAX_MESSAGE_LEN,0,0,0)
var/new_message = sanitize(tgui_input_text(user,"Use double enter between messages to enter a new one. Must be at least 3 characters long, 160 characters max and up to 10 messages are allowed.","Heat Discomfort messages",old_message, multiline= TRUE, encode = FALSE, prevent_enter = TRUE), MAX_MESSAGE_LEN,0,0,0)
if(length(new_message) > 0)
var/list/raw_list = splittext(new_message,"\n\n")
if(raw_list.len > 10)
@@ -285,7 +285,7 @@
if("custom_cold")
tgui_alert(user, "You are setting custom cold messages. These will overwrite your species' defaults. To return to defaults, click reset.")
var/old_message = pref.custom_heat.Join("\n\n")
var/new_message = sanitize(tgui_input_text(user,"Use double enter between messages to enter a new one. Must be at least 3 characters long, 160 characters max and up to 10 messages are allowed.","Cold Discomfort messages",old_message, multiline= TRUE, prevent_enter = TRUE), MAX_MESSAGE_LEN,0,0,0)
var/new_message = sanitize(tgui_input_text(user,"Use double enter between messages to enter a new one. Must be at least 3 characters long, 160 characters max and up to 10 messages are allowed.","Cold Discomfort messages",old_message, multiline= TRUE, encode = FALSE, prevent_enter = TRUE), MAX_MESSAGE_LEN,0,0,0)
if(length(new_message) > 0)
var/list/raw_list = splittext(new_message,"\n\n")
if(raw_list.len > 10)
@@ -329,7 +329,7 @@
pref.custom_heat = list()
return TOPIC_REFRESH
if("custom_species")
var/raw_choice = sanitize(tgui_input_text(user, "Input your custom species name:",
"Character Preference", pref.custom_species, MAX_NAME_LEN), MAX_NAME_LEN)
var/raw_choice = tgui_input_text(user, "Input your custom species name:",
"Character Preference", pref.custom_species, MAX_NAME_LEN)
pref.custom_species = raw_choice
return TOPIC_REFRESH

View File

@@ -212,7 +212,7 @@
if(!choice)
return TOPIC_NOACTION
if(choice == "Other")
var/raw_choice = sanitize(tgui_input_text(user, "Please enter a custom ringtone. If this doesn't match any of the other listed choices, your PDA will use the default (\"beep\") sound.", "Character Preference", null, 20), 20)
var/raw_choice = tgui_input_text(user, "Please enter a custom ringtone. If this doesn't match any of the other listed choices, your PDA will use the default (\"beep\") sound.", "Character Preference", null, 20)
if(raw_choice)
pref.ringtone = raw_choice
else

View File

@@ -218,7 +218,7 @@ var/datum/gear_tweak/custom_name/gear_tweak_free_name = new()
return
if(valid_custom_names)
return tgui_input_list(user, "Choose an item name.", "Character Preference", valid_custom_names, metadata)
var/san_input = sanitize(tgui_input_text(user, "Choose the item's name. Leave it blank to use the default name.", "Item Name", metadata, MAX_LNAME_LEN), MAX_LNAME_LEN, extra = 0)
var/san_input = tgui_input_text(user, "Choose the item's name. Leave it blank to use the default name.", "Item Name", metadata, MAX_LNAME_LEN)
return san_input ? san_input : get_default()
/datum/gear_tweak/custom_name/tweak_item(var/obj/item/I, var/metadata)
@@ -250,7 +250,7 @@ var/datum/gear_tweak/custom_desc/gear_tweak_free_desc = new()
return
if(valid_custom_desc)
return tgui_input_list(user, "Choose an item description.", "Character Preference",valid_custom_desc, metadata)
var/san_input = sanitize(tgui_input_text(user, "Choose the item's description. Leave it blank to use the default description.", "Item Description", metadata, multiline = TRUE, prevent_enter = TRUE), extra = 0)
var/san_input = tgui_input_text(user, "Choose the item's description. Leave it blank to use the default description.", "Item Description", metadata, MAX_MESSAGE_LEN, TRUE, prevent_enter = TRUE)
return san_input ? san_input : get_default()
/datum/gear_tweak/custom_desc/tweak_item(var/obj/item/I, var/metadata)
@@ -606,7 +606,7 @@ var/datum/gear_tweak/custom_desc/gear_tweak_free_desc = new()
return ""
/datum/gear_tweak/collar_tag/get_metadata(var/user, var/metadata)
return sanitize( tgui_input_text(user, "Choose the tag text", "Character Preference", metadata, MAX_NAME_LEN), MAX_NAME_LEN )
return tgui_input_text(user, "Choose the tag text", "Character Preference", metadata, MAX_NAME_LEN)
/datum/gear_tweak/collar_tag/tweak_item(var/obj/item/clothing/accessory/collar/C, var/metadata)
if(metadata == "")

View File

@@ -306,7 +306,7 @@ GLOBAL_LIST_EMPTY(chardirectory_photos)
return set_for_mind_or_prefs(user, action, !visible, can_set_prefs, can_set_mind)
if ("editAd")
var/current_ad = (can_set_mind ? user.mind.directory_ad : null) || (can_set_prefs ? user.client.prefs.directory_ad : null)
var/new_ad = sanitize(tgui_input_text(user, "Change your character ad", "Character Ad", current_ad, multiline = TRUE, prevent_enter = TRUE), extra = 0)
var/new_ad = tgui_input_text(user, "Change your character ad", "Character Ad", current_ad, MAX_MESSAGE_LEN, TRUE, prevent_enter = TRUE)
if(isnull(new_ad))
return
return set_for_mind_or_prefs(user, action, new_ad, can_set_prefs, can_set_mind)

View File

@@ -41,7 +41,7 @@
if(!M.mind)
return 0
var/input = sanitizeSafe(tgui_input_text(M, "Who do you want to dedicate the bracelet to?","Friendship Bracelet" ,"", MAX_NAME_LEN), MAX_NAME_LEN)
var/input = sanitizeSafe(tgui_input_text(M, "Who do you want to dedicate the bracelet to?","Friendship Bracelet" ,"", MAX_NAME_LEN, encode = FALSE), MAX_NAME_LEN)
if(src && input && !M.stat && in_range(M,src))
desc = "A beautiful friendship bracelet in all the colors of the rainbow. It's dedicated to [input]."

View File

@@ -123,7 +123,7 @@
var/input = tgui_input_text(user, "Would you like to change the holoengraving on the ring?", "Name your spouse", "Bae", MAX_NAME_LEN)
if(!input)
return
partnername = sanitize(input)
partnername = input
name = "[initial(name)] - [partnername]"
/obj/item/clothing/accessory/ring/wedding/silver

View File

@@ -8,7 +8,7 @@
body_parts_covered = null
/obj/item/clothing/gloves/weddingring/attack_self(mob/user)
partnername = copytext(sanitize(tgui_input_text(user, "Would you like to change the holoengraving on the ring?", "Name your betrothed", "Bae", MAX_NAME_LEN)),1,MAX_NAME_LEN)
partnername = tgui_input_text(user, "Would you like to change the holoengraving on the ring?", "Name your betrothed", "Bae", MAX_NAME_LEN)
name = "[initial(name)] - [partnername]"
/obj/item/clothing/gloves/weddingring/silver

View File

@@ -44,7 +44,7 @@
voice_holder.active = 0
to_chat(usr, span_blue("You disable the speech synthesiser."))
if("Set Name")
var/raw_choice = sanitize(tgui_input_text(usr, "Please enter a new name.", voice_holder.voice, MAX_NAME_LEN))
var/raw_choice = tgui_input_text(usr, "Please enter a new name.", "Change name", voice_holder.voice, MAX_NAME_LEN)
if(!raw_choice)
return 0
voice_holder.voice = raw_choice

View File

@@ -336,7 +336,7 @@
voice_holder.active = 0
to_chat(usr, span_blue("You disable the speech synthesiser."))
if("Set Name")
var/raw_choice = sanitize(tgui_input_text(usr, "Please enter a new name.", max_length=MAX_NAME_LEN))
var/raw_choice = tgui_input_text(usr, "Please enter a new name.", max_length=MAX_NAME_LEN)
if(!raw_choice)
return 0
voice_holder.voice = raw_choice

View File

@@ -160,7 +160,7 @@
if("change_id")
var/attempt_code = tgui_input_number(usr, "Re-enter the current EFTPOS access code", "Confirm EFTPOS code")
if(attempt_code == access_code)
eftpos_name = sanitize(tgui_input_text(usr, "Enter a new terminal ID for this device", "Enter new EFTPOS ID",max_length=MAX_NAME_LEN), MAX_NAME_LEN) + " EFTPOS scanner"
eftpos_name = tgui_input_text(usr, "Enter a new terminal ID for this device", "Enter new EFTPOS ID",max_length=MAX_NAME_LEN) + " EFTPOS scanner"
print_reference()
else
to_chat(usr, "[icon2html(src, usr.client)]" + span_warning("Incorrect code entered."))
@@ -175,7 +175,7 @@
else
to_chat(usr, "[icon2html(src, usr.client)]" + span_warning("Account not found."))
if("trans_purpose")
var/choice = sanitize(tgui_input_text(usr, "Enter reason for EFTPOS transaction", "Transaction purpose"))
var/choice = tgui_input_text(usr, "Enter reason for EFTPOS transaction", "Transaction purpose", MAX_MESSAGE_LEN)
if(choice)
transaction_purpose = choice
if("trans_value")

View File

@@ -121,7 +121,7 @@
else
to_chat(usr, "[icon2html(src, usr.client)]" + span_warning("Account not found."))
if("custom_order")
var/t_purpose = sanitize(tgui_input_text(usr, "Enter purpose", "New purpose"))
var/t_purpose = tgui_input_text(usr, "Enter purpose", "New purpose", "", MAX_MESSAGE_LEN)
if (!t_purpose || !Adjacent(usr)) return
transaction_purpose = t_purpose
item_list += t_purpose

View File

@@ -118,7 +118,7 @@
else
to_chat(usr, "[icon2html(src, usr.client)]" + span_warning("Account not found."))
if("custom_order")
var/t_purpose = sanitize(tgui_input_text(usr, "Enter purpose", "New purpose"))
var/t_purpose = tgui_input_text(usr, "Enter purpose", "New purpose", "", MAX_MESSAGE_LEN)
if (!t_purpose || !Adjacent(usr)) return
transaction_purpose = t_purpose
item_list += t_purpose

View File

@@ -8,7 +8,7 @@
var/input
if(!message)
input = sanitize(tgui_input_text(src,"Choose an emote to display."))
input = tgui_input_text(src,"Choose an emote to display.", max_length = MAX_MESSAGE_LEN)
else
input = message
process_normal_emote(m_type, message, input, range)

View File

@@ -72,7 +72,7 @@ GLOBAL_LIST_EMPTY(env_messages)
if(!istype(src) || !get_turf(src) || !src.ckey)
return
var/new_message = sanitize(tgui_input_text(src, "Type in your message. It will be displayed to players who hover over the spot where you are right now. If you already have a message somewhere, it will be removed in the process. Please refrain from abusive or deceptive messages, but otherwise, feel free to be creative!", "Env Message"))
var/new_message = tgui_input_text(src, "Type in your message. It will be displayed to players who hover over the spot where you are right now. If you already have a message somewhere, it will be removed in the process. Please refrain from abusive or deceptive messages, but otherwise, feel free to be creative!", "Env Message", MAX_MESSAGE_LEN)
if(!new_message)
return
@@ -136,7 +136,7 @@ GLOBAL_LIST_EMPTY(env_messages)
if(!get_turf(mob) || !src.ckey)
return
var/new_message = sanitize(tgui_input_text(src, "Type in your message. It will be displayed to players who hover over the spot where you are right now.", "Env Message"))
var/new_message = tgui_input_text(src, "Type in your message. It will be displayed to players who hover over the spot where you are right now.", "Env Message", "", MAX_MESSAGE_LEN)
if(!new_message)
return

Some files were not shown because too many files have changed in this diff Show More