[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
@@ -30,7 +30,7 @@
if("PRG_newtextfile")
if(!HDD)
return
var/newname = sanitize(tgui_input_text(ui.user, "Enter file name or leave blank to cancel:", "File rename"))
var/newname = tgui_input_text(ui.user, "Enter file name or leave blank to cancel:", "File rename", "", MAX_MESSAGE_LEN)
if(!newname)
return
if(HDD.find_file_by_name(newname))
@@ -66,7 +66,7 @@
var/oldtext = html_decode(F.stored_data)
oldtext = replacetext(oldtext, "\[br\]", "\n")
var/newtext = sanitize(replacetext(tgui_input_text(ui.user, "Editing file [F.filename].[F.filetype]. You may use most tags used in paper formatting:", "Text Editor", oldtext, MAX_TEXTFILE_LENGTH, TRUE, prevent_enter = TRUE), "\n", "\[br\]"), MAX_TEXTFILE_LENGTH)
var/newtext = replacetext(tgui_input_text(ui.user, "Editing file [F.filename].[F.filetype]. You may use most tags used in paper formatting:", "Text Editor", oldtext, MAX_TEXTFILE_LENGTH, TRUE, prevent_enter = TRUE), "\n", "\[br\]")
if(!newtext)
return
@@ -106,7 +106,7 @@
if(downloading || !loaded_article)
return
var/savename = sanitize(tgui_input_text(ui.user, "Enter file name or leave blank to cancel:", "Save article", loaded_article.filename))
var/savename = tgui_input_text(ui.user, "Enter file name or leave blank to cancel:", "Save article", loaded_article.filename, "", MAX_MESSAGE_LEN)
if(!savename)
return TRUE
var/obj/item/computer_hardware/hard_drive/HDD = computer.hard_drive
@@ -134,7 +134,7 @@ var/global/nttransfer_uid = 0
if(!remote || !remote.provided_file)
return
if(remote.server_password)
var/pass = sanitize(tgui_input_text(ui.user, "Code 401 Unauthorized. Please enter password:", "Password required"))
var/pass = tgui_input_text(ui.user, "Code 401 Unauthorized. Please enter password:", "Password required", "", MAX_MESSAGE_LEN)
if(pass != remote.server_password)
error = "Incorrect Password"
return
@@ -152,7 +152,7 @@ var/global/nttransfer_uid = 0
provided_file = null
return TRUE
if("PRG_setpassword")
var/pass = sanitize(tgui_input_text(ui.user, "Enter new server password. Leave blank to cancel, input 'none' to disable password.", "Server security", "none"))
var/pass = tgui_input_text(ui.user, "Enter new server password. Leave blank to cancel, input 'none' to disable password.", "Server security", "none", MAX_MESSAGE_LEN)
if(!pass)
return
if(pass == "none")
@@ -133,7 +133,7 @@
if(tgui_alert(ui.user, "Would you like to save your changes first?","Save Changes",list("Yes","No")) == "Yes")
save_file(open_file)
var/newname = sanitize(tgui_input_text(ui.user, "Enter file name:", "New File"))
var/newname = tgui_input_text(ui.user, "Enter file name:", "New File", "", MAX_MESSAGE_LEN)
if(!newname)
return TRUE
var/datum/computer_file/data/F = create_file(newname)
@@ -146,7 +146,7 @@
return TRUE
if("PRG_saveasfile")
var/newname = sanitize(tgui_input_text(ui.user, "Enter file name:", "Save As"))
var/newname = tgui_input_text(ui.user, "Enter file name:", "Save As", "", MAX_MESSAGE_LEN)
if(!newname)
return TRUE
var/datum/computer_file/data/F = create_file(newname, loaded_data)
@@ -158,7 +158,7 @@
if("PRG_savefile")
if(!open_file)
open_file = sanitize(tgui_input_text(ui.user, "Enter file name:", "Save As"))
open_file = tgui_input_text(ui.user, "Enter file name:", "Save As", "", MAX_MESSAGE_LEN)
if(!open_file)
return 0
if(!save_file(open_file))
@@ -169,7 +169,7 @@
var/oldtext = html_decode(loaded_data)
oldtext = replacetext(oldtext, "\[br\]", "\n")
var/newtext = sanitize(replacetext(tgui_input_text(ui.user, "Editing file '[open_file]'. You may use most tags used in paper formatting:", "Text Editor", oldtext, MAX_TEXTFILE_LENGTH, TRUE, prevent_enter = TRUE), "\n", "\[br\]"), MAX_TEXTFILE_LENGTH)
var/newtext = replacetext(tgui_input_text(ui.user, "Editing file '[open_file]'. You may use most tags used in paper formatting:", "Text Editor", oldtext, MAX_TEXTFILE_LENGTH, TRUE, prevent_enter = TRUE), "\n", "\[br\]")
if(!newtext)
return
loaded_data = newtext
@@ -93,7 +93,7 @@
if(!current_account)
return TRUE
var/newpass = sanitize(tgui_input_text(ui.user,"Enter new password for account [current_account.login]", "Password", null, 100), 100)
var/newpass = tgui_input_text(ui.user,"Enter new password for account [current_account.login]", "Password", null, 100)
if(!newpass)
return TRUE
current_account.password = newpass
@@ -118,10 +118,10 @@
return TRUE
if("newaccount")
var/newdomain = sanitize(tgui_input_list(ui.user,"Pick domain:", "Domain name", using_map.usable_email_tlds))
var/newdomain = tgui_input_list(ui.user,"Pick domain:", "Domain name", using_map.usable_email_tlds, MAX_MESSAGE_LEN)
if(!newdomain)
return TRUE
var/newlogin = sanitize(tgui_input_text(ui.user,"Pick account name (@[newdomain]):", "Account name", null, 100), 100)
var/newlogin = tgui_input_text(ui.user,"Pick account name (@[newdomain]):", "Account name", null, 100)
if(!newlogin)
return TRUE
@@ -112,7 +112,7 @@ var/warrant_uid = 0
var/namelist = list()
for(var/datum/data/record/t in GLOB.data_core.general)
namelist += t.fields["name"]
var/new_name = sanitize(tgui_input_list(ui.user, "Please input name:", "Name Choice", namelist))
var/new_name = tgui_input_list(ui.user, "Please input name:", "Name Choice", namelist)
if(tgui_status(ui.user, state) == STATUS_INTERACTIVE)
if (!new_name)
return
@@ -120,7 +120,7 @@ var/warrant_uid = 0
if("editwarrantnamecustom")
. = TRUE
var/new_name = sanitize(tgui_input_text(ui.user, "Please input name"))
var/new_name = tgui_input_text(ui.user, "Please input name", max_length = MAX_MESSAGE_LEN)
if(tgui_status(ui.user, state) == STATUS_INTERACTIVE)
if (!new_name)
return
@@ -128,7 +128,7 @@ var/warrant_uid = 0
if("editwarrantcharges")
. = TRUE
var/new_charges = sanitize(tgui_input_text(ui.user, "Please input charges", "Charges", activewarrant.fields["charges"]))
var/new_charges = tgui_input_text(ui.user, "Please input charges", "Charges", activewarrant.fields["charges"], max_length = MAX_MESSAGE_LEN)
if(tgui_status(ui.user, state) == STATUS_INTERACTIVE)
if (!new_charges)
return