sanitize() refactor: second pass(other sanitize functions)

This commit is contained in:
volas
2015-03-23 01:38:09 +03:00
parent 855755f808
commit f8822626bb
51 changed files with 86 additions and 101 deletions

View File

@@ -311,7 +311,7 @@ Turf and target are seperate in case you want to teleport some distance from a t
newname = input(src,"You are a [role]. Would you like to change your name to something else?", "Name change",oldname) as text
if((world.time-time_passed)>300)
return //took too long
newname = reject_bad_name(newname,allow_numbers) //returns null if the name doesn't meet some basic requirements. Tidies up a few other things like bad-characters.
newname = sanitizeName(newname, ,allow_numbers) //returns null if the name doesn't meet some basic requirements. Tidies up a few other things like bad-characters.
for(var/mob/living/M in player_list)
if(M == src)

View File

@@ -36,8 +36,8 @@
var/tmp/message_title = new_title ? new_title : title
var/tmp/message_sound = new_sound ? sound(new_sound) : sound
message = trim_strip_html_properly(message)
message_title = html_encode(message_title)
message = sanitize(message, extra = 0)
message_title = sanitizeSafe(message_title)
Message(message, message_title)
if(do_newscast)

View File

@@ -697,7 +697,7 @@ var/list/datum/dna/hivemind_bank = list()
src << "<span class='notice'>We return our vocal glands to their original location.</span>"
return
var/mimic_voice = stripped_input(usr, "Enter a name to mimic.", "Mimic Voice", null, MAX_NAME_LEN)
var/mimic_voice = sanitize(input(usr, "Enter a name to mimic.", "Mimic Voice", null), MAX_NAME_LEN)
if(!mimic_voice)
return

View File

@@ -564,7 +564,7 @@ var/list/sacrificed = list()
// returns 0 if the rune is not used. returns 1 if the rune is used.
communicate()
. = 1 // Default output is 1. If the rune is deleted it will return 1
var/input = stripped_input(usr, "Please choose a message to tell to the other acolytes.", "Voice of Blood", "")
var/input = sanitize(input(usr, "Please choose a message to tell to the other acolytes.", "Voice of Blood", ""))
if(!input)
if (istype(src))
fizzle()

View File

@@ -355,7 +355,7 @@ text("<A href='?src=\ref[src];operation=oddbutton'>[src.oddbutton ? "Yes" : "No"
del(src)
else if (istype(W, /obj/item/weapon/pen))
var/t = copytext(stripped_input(user, "Enter new robot name", src.name, src.created_name),1,MAX_NAME_LEN)
var/t = sanitizeSafe(input(user, "Enter new robot name", src.name, src.created_name), MAX_NAME_LEN)
if (!t)
return
if (!in_range(src, usr) && src.loc != usr)

View File

@@ -58,7 +58,7 @@
..()
if(istype(W, /obj/item/weapon/pen))
var/t = copytext(stripped_input(user, "Enter new robot name", src.name, src.created_name),1,MAX_NAME_LEN)
var/t = sanitizeSafe(input(user, "Enter new robot name", src.name, src.created_name), MAX_NAME_LEN)
if(!t) return
if(!in_range(src, usr) && src.loc != usr) return
created_name = t

View File

@@ -420,7 +420,7 @@
del(src)
else if (istype(W, /obj/item/weapon/pen))
var/t = copytext(stripped_input(user, "Enter new robot name", src.name, src.created_name),1,MAX_NAME_LEN)
var/t = sanitizeSafe(input(user, "Enter new robot name", src.name, src.created_name), MAX_NAME_LEN)
if (!t)
return
if (!in_range(src, usr) && src.loc != usr)
@@ -439,7 +439,7 @@
user.drop_from_inventory(src)
del(src)
else if (istype(W, /obj/item/weapon/pen))
var/t = stripped_input(user, "Enter new robot name", src.name, src.created_name)
var/t = sanitizeSafe(input(user, "Enter new robot name", src.name, src.created_name), MAX_NAME_LEN)
if (!t)
return

View File

@@ -564,7 +564,7 @@
/obj/item/weapon/firstaid_arm_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
if(istype(W, /obj/item/weapon/pen))
var/t = copytext(stripped_input(user, "Enter new robot name", src.name, src.created_name),1,MAX_NAME_LEN)
var/t = sanitizeSafe(input(user, "Enter new robot name", src.name, src.created_name), MAX_NAME_LEN)
if (!t)
return
if (!in_range(src, usr) && src.loc != usr)

View File

@@ -838,7 +838,7 @@ Auto Patrol: []"},
del(src)
else if(istype(W, /obj/item/weapon/pen))
var/t = copytext(stripped_input(user, "Enter new robot name", src.name, src.created_name),1,MAX_NAME_LEN)
var/t = sanitizeSafe(input(user, "Enter new robot name", src.name, src.created_name), MAX_NAME_LEN)
if(!t)
return
if(!in_range(src, usr) && src.loc != usr)

View File

@@ -78,7 +78,7 @@
if(isscrewdriver(W))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
var/input = strip_html(input(usr, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: SS13,Security,Secret ", "Set Network", "SS13"))
var/input = sanitize(input(usr, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: SS13,Security,Secret ", "Set Network", "SS13"))
if(!input)
usr << "No input found please hang up and try your call again."
return
@@ -90,7 +90,7 @@
var/area/camera_area = get_area(src)
var/temptag = "[sanitize(camera_area.name)] ([rand(1, 999)])"
input = strip_html(input(usr, "How would you like to name the camera?", "Set Camera Name", temptag))
input = sanitizeSafe(input(usr, "How would you like to name the camera?", "Set Camera Name", temptag))
state = 4
var/obj/machinery/camera/C = new(src.loc)

View File

@@ -222,7 +222,7 @@
if (is_authenticated())
var/t2 = modify
if ((modify == t2 && (in_range(src, usr) || (istype(usr, /mob/living/silicon))) && istype(loc, /turf)))
var/temp_name = reject_bad_name(href_list["reg"])
var/temp_name = sanitizeName(href_list["reg"])
if(temp_name)
modify.registered_name = temp_name
else

View File

@@ -187,7 +187,7 @@
if(centcomm_message_cooldown)
usr << "\red Arrays recycling. Please stand by."
return
var/input = stripped_input(usr, "Please choose a message to transmit to Centcomm via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response. There is a 30 second delay before you may send another message, be clear, full and concise.", "To abort, send an empty message.", "")
var/input = sanitize(input("Please choose a message to transmit to Centcomm via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response. There is a 30 second delay before you may send another message, be clear, full and concise.", "To abort, send an empty message.", ""))
if(!input || !(usr in view(1,src)))
return
Centcomm_announce(input, usr)
@@ -204,7 +204,7 @@
if(centcomm_message_cooldown)
usr << "\red Arrays recycling. Please stand by."
return
var/input = stripped_input(usr, "Please choose a message to transmit to \[ABNORMAL ROUTING CORDINATES\] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response. There is a 30 second delay before you may send another message, be clear, full and concise.", "To abort, send an empty message.", "")
var/input = sanitize(input(usr, "Please choose a message to transmit to \[ABNORMAL ROUTING CORDINATES\] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response. There is a 30 second delay before you may send another message, be clear, full and concise.", "To abort, send an empty message.", ""))
if(!input || !(usr in view(1,src)))
return
Syndicate_announce(input, usr)

View File

@@ -114,11 +114,11 @@
if (href_list["choice"])
switch(href_list["choice"])
if ("giv_name")
var/nam = strip_html_simple(input("Person pass is issued to", "Name", giv_name) as text|null)
var/nam = sanitize(input("Person pass is issued to", "Name", giv_name) as text|null)
if (nam)
giv_name = nam
if ("reason")
var/reas = strip_html_simple(input("Reason why pass is issued", "Reason", reason) as text|null)
var/reas = sanitize(input("Reason why pass is issued", "Reason", reason) as text|null)
if(reas)
reason = reas
if ("duration")

View File

@@ -426,7 +426,7 @@ What a mess.*/
switch(href_list["field"])
if("name")
if (istype(active1, /datum/data/record))
var/t1 = reject_bad_name(input("Please input name:", "Secure. records", active1.fields["name"], null) as text)
var/t1 = sanitizeName(input("Please input name:", "Secure. records", active1.fields["name"], null) as text)
if (!t1 || active1 != a1)
return
active1.fields["name"] = t1

View File

@@ -309,7 +309,7 @@ What a mess.*/
switch(href_list["field"])
if("name")
if (istype(active1, /datum/data/record))
var/t1 = reject_bad_name(input("Please input name:", "Secure. records", active1.fields["name"], null) as text)
var/t1 = sanitizeName(input("Please input name:", "Secure. records", active1.fields["name"], null) as text)
if ((!( t1 ) || !length(trim(t1)) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon)))) || active1 != a1)
return
active1.fields["name"] = t1

View File

@@ -192,7 +192,7 @@
if(centcomm_message_cooldown)
usr << "Arrays recycling. Please stand by."
return
var/input = stripped_input(usr, "Please choose a message to transmit to Centcomm via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "To abort, send an empty message.", "")
var/input = sanitize(input("Please choose a message to transmit to Centcomm via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "To abort, send an empty message.", ""))
if(!input || !interactable())
return
Centcomm_announce(input, usr)
@@ -209,7 +209,7 @@
if(centcomm_message_cooldown)
usr << "Arrays recycling. Please stand by."
return
var/input = stripped_input(usr, "Please choose a message to transmit to \[ABNORMAL ROUTING CORDINATES\] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "To abort, send an empty message.", "")
var/input = sanitize(input(usr, "Please choose a message to transmit to \[ABNORMAL ROUTING CORDINATES\] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "To abort, send an empty message.", ""))
if(!input || !interactable())
return
Syndicate_announce(input, usr)

View File

@@ -444,7 +444,7 @@ What a mess.*/
switch(href_list["field"])
if("name")
if (istype(active1, /datum/data/record))
var/t1 = reject_bad_name(input("Please input name:", "Secure. records", active1.fields["name"], null) as text)
var/t1 = sanitizeName(input("Please input name:", "Secure. records", active1.fields["name"], null) as text)
if ((!( t1 ) || !length(trim(t1)) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon)))) || active1 != a1)
return
active1.fields["name"] = t1

View File

@@ -496,9 +496,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.set_machine(src)
if(href_list["set_channel_name"])
src.channel_name = strip_html(input(usr, "Provide a Feed Channel Name", "Network Channel Handler", ""))
while (findtext(src.channel_name," ") == 1)
src.channel_name = copytext(src.channel_name,2,lentext(src.channel_name)+1)
src.channel_name = sanitizeSafe(input(usr, "Provide a Feed Channel Name", "Network Channel Handler", ""))
src.updateUsrDialog()
//src.update_icon()
@@ -541,9 +539,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
src.updateUsrDialog()
else if(href_list["set_new_message"])
src.msg = strip_html(input(usr, "Write your Feed story", "Network Channel Handler", ""))
while (findtext(src.msg," ") == 1)
src.msg = copytext(src.msg,2,lentext(src.msg)+1)
src.msg = sanitize(input(usr, "Write your Feed story", "Network Channel Handler", ""))
src.updateUsrDialog()
else if(href_list["set_attachment"])
@@ -600,15 +596,11 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
src.updateUsrDialog()
else if(href_list["set_wanted_name"])
src.channel_name = strip_html(input(usr, "Provide the name of the Wanted person", "Network Security Handler", ""))
while (findtext(src.channel_name," ") == 1)
src.channel_name = copytext(src.channel_name,2,lentext(src.channel_name)+1)
src.channel_name = sanitizeSafe(input(usr, "Provide the name of the Wanted person", "Network Security Handler", ""))
src.updateUsrDialog()
else if(href_list["set_wanted_desc"])
src.msg = strip_html(input(usr, "Provide the a description of the Wanted person and any other details you deem important", "Network Security Handler", ""))
while (findtext(src.msg," ") == 1)
src.msg = copytext(src.msg,2,lentext(src.msg)+1)
src.msg = sanitize(input(usr, "Provide the a description of the Wanted person and any other details you deem important", "Network Security Handler", ""))
src.updateUsrDialog()
else if(href_list["submit_wanted"])
@@ -944,7 +936,7 @@ obj/item/weapon/newspaper/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(src.scribble_page == src.curr_page)
user << "<FONT COLOR='blue'>There's already a scribble in this page... You wouldn't want to make things too cluttered, would you?</FONT>"
else
var/s = strip_html( input(user, "Write something", "Newspaper", "") )
var/s = sanitize(input(user, "Write something", "Newspaper", ""))
s = sanitize(s)
if (!s)
return

View File

@@ -1569,8 +1569,8 @@
return
if (href_list["change_name"])
if(usr != src.occupant) return
var/newname = strip_html_simple(input(occupant,"Choose new exosuit name","Rename exosuit",initial(name)) as text, MAX_NAME_LEN)
if(newname && trim(newname))
var/newname = sanitizeSafe(input(occupant,"Choose new exosuit name","Rename exosuit",initial(name)) as text, MAX_NAME_LEN)
if(newname)
name = newname
else
alert(occupant, "nope.avi")

View File

@@ -43,9 +43,9 @@
var/datum/topic_input/filter = new /datum/topic_input(href,href_list)
if(href_list["send_message"])
var/obj/item/mecha_parts/mecha_tracking/MT = filter.getObj("send_message")
var/message = strip_html_simple(input(usr,"Input message","Transmit message") as text)
var/message = sanitize(input(usr,"Input message","Transmit message") as text)
var/obj/mecha/M = MT.in_mecha()
if(trim(message) && M)
if(message && M)
M.occupant_message(message)
return
if(href_list["shock"])

View File

@@ -114,7 +114,7 @@ move an amendment</a> to the drawing.</p>
usr << "\red Error! Please notify administration!"
return
var/list/turf/turfs = res
var/str = trim(stripped_input(usr,"New area name:","Blueprint Editing", "", MAX_NAME_LEN))
var/str = sanitizeSafe(input("New area name:","Blueprint Editing", ""), MAX_NAME_LEN)
if(!str || !length(str)) //cancel
return
if(length(str) > 50)
@@ -154,7 +154,7 @@ move an amendment</a> to the drawing.</p>
var/area/A = get_area()
//world << "DEBUG: edit_area"
var/prevname = "[A.name]"
var/str = trim(stripped_input(usr,"New area name:","Blueprint Editing", prevname, MAX_NAME_LEN))
var/str = sanitizeSafe(input("New area name:","Blueprint Editing", prevname), MAX_NAME_LEN)
if(!str || !length(str) || str==prevname) //cancel
return
if(length(str) > 50)

View File

@@ -689,7 +689,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
if ("Edit")
var/n = input(U, "Please enter message", name, notehtml) as message
if (in_range(src, U) && loc == U)
n = copytext(adminscrub(n), 1, MAX_MESSAGE_LEN)
n = sanitizeSafe(n, extra = 0)
if (mode == 1)
note = html_decode(n)
notehtml = note
@@ -972,7 +972,8 @@ var/global/list/obj/item/device/pda/PDAs = list()
U.last_target_click = world.time
var/t = input(U, "Please enter message", P.name, null) as text
t = sanitize(t)
t = readd_quotes(t)
//t = readd_quotes(t)
t = replace_characters(t, list("&#34;" = "\""))
if (!t || !istype(P))
return
if (!in_range(src, U) && loc != U)

View File

@@ -233,7 +233,7 @@
user << "\blue The MMI must go in after everything else!"
if (istype(W, /obj/item/weapon/pen))
var/t = stripped_input(user, "Enter new robot name", src.name, src.created_name, MAX_NAME_LEN)
var/t = sanitizeSafe(input(user, "Enter new robot name", src.name, src.created_name), MAX_NAME_LEN)
if (!t)
return
if (!in_range(src, usr) && src.loc != usr)

View File

@@ -53,7 +53,7 @@
var/heldname = "default name"
/obj/item/borg/upgrade/rename/attack_self(mob/user as mob)
heldname = stripped_input(user, "Enter new robot name", "Robot Reclassification", heldname, MAX_NAME_LEN)
heldname = sanitizeSafe(input(user, "Enter new robot name", "Robot Reclassification", heldname), MAX_NAME_LEN)
/obj/item/borg/upgrade/rename/action(var/mob/living/silicon/robot/R)
if(..()) return 0

View File

@@ -98,7 +98,7 @@ AI MODULES
/obj/item/weapon/aiModule/safeguard/attack_self(var/mob/user as mob)
..()
var/targName = stripped_input(usr, "Please enter the name of the person to safeguard.", "Safeguard who?", user.name)
var/targName = sanitize(input("Please enter the name of the person to safeguard.", "Safeguard who?", user.name))
targetName = targName
desc = text("A 'safeguard' AI module: 'Safeguard []. Individuals that threaten [] are not human and are a threat to humans.'", targetName, targetName)
@@ -127,7 +127,7 @@ AI MODULES
/obj/item/weapon/aiModule/oneHuman/attack_self(var/mob/user as mob)
..()
var/targName = stripped_input(usr, "Please enter the name of the person who is the only human.", "Who?", user.real_name)
var/targName = sanitize(input("Please enter the name of the person who is the only human.", "Who?", user.real_name))
targetName = targName
desc = text("A 'one human' AI module: 'Only [] is human.'", targetName)
@@ -378,7 +378,7 @@ AI MODULES
/obj/item/weapon/aiModule/freeformcore/attack_self(var/mob/user as mob)
..()
var/newlaw = ""
var/targName = stripped_input(usr, "Please enter a new core law for the AI.", "Freeform Law Entry", newlaw)
var/targName = sanitize(input("Please enter a new core law for the AI.", "Freeform Law Entry", newlaw))
newFreeFormLaw = targName
desc = "A 'freeform' Core AI module: '[newFreeFormLaw]'"
@@ -403,7 +403,7 @@ AI MODULES
/obj/item/weapon/aiModule/syndicate/attack_self(var/mob/user as mob)
..()
var/newlaw = ""
var/targName = stripped_input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw,MAX_MESSAGE_LEN)
var/targName = sanitize(input("Please enter a new law for the AI.", "Freeform Law Entry", newlaw))
newFreeFormLaw = targName
desc = "A hacked AI law module: '[newFreeFormLaw]'"

View File

@@ -224,7 +224,7 @@
/obj/item/weapon/card/id/syndicate/attack_self(mob/user as mob)
if(!src.registered_name)
//Stop giving the players unsanitized unputs! You are giving ways for players to intentionally crash clients! -Nodrak
var t = reject_bad_name(input(user, "What name would you like to put on this card?", "Agent card name", ishuman(user) ? user.real_name : user.name))
var t = sanitizeName(input(user, "What name would you like to put on this card?", "Agent card name", ishuman(user) ? user.real_name : user.name))
if(!t) //Same as mob/new_player/prefrences.dm
alert("Invalid name.")
return

View File

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

View File

@@ -152,7 +152,7 @@ Implant Specifics:<BR>"}
hear(var/msg)
var/list/replacechars = list("'" = "","\"" = "",">" = "","<" = "","(" = "",")" = "")
msg = sanitize_simple(msg, replacechars)
msg = replace_characters(msg, replacechars)
if(findtext(msg,phrase))
activate()
del(src)
@@ -206,7 +206,7 @@ Implant Specifics:<BR>"}
elevel = alert("What sort of explosion would you prefer?", "Implant Intent", "Localized Limb", "Destroy Body", "Full Explosion")
phrase = input("Choose activation phrase:") as text
var/list/replacechars = list("'" = "","\"" = "",">" = "","<" = "","(" = "",")" = "")
phrase = sanitize_simple(phrase, replacechars)
phrase = replace_characters(phrase, replacechars)
usr.mind.store_memory("Explosive implant in [source] can be activated by saying something containing the phrase ''[src.phrase]'', <B>say [src.phrase]</B> to attempt to activate.", 0, 0)
usr << "The implanted explosive implant in [source] can be activated by saying something containing the phrase ''[src.phrase]'', <B>say [src.phrase]</B> to attempt to activate."
return 1

View File

@@ -135,7 +135,7 @@
/obj/structure/door_assembly/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/pen))
var/t = copytext(stripped_input(user, "Enter the name for the door.", src.name, src.created_name),1,MAX_NAME_LEN)
var/t = sanitizeSafe(input(user, "Enter the name for the door.", src.name, src.created_name), MAX_NAME_LEN)
if(!t) return
if(!in_range(src, usr) && src.loc != usr) return
created_name = t

View File

@@ -728,7 +728,7 @@ var/global/floorIsLava = 0
var/message = input("Global message to send:", "Admin Announce", null, null) as message
if(message)
if(!check_rights(R_SERVER,0))
message = adminscrub(message,500)
message = sanitize(message, 500, extra = 0)
world << "\blue <b>[usr.client.holder.fakekey ? "Administrator" : usr.key] Announces:</b>\n \t [message]"
log_admin("Announce: [key_name(usr)] : [message]")
feedback_add_details("admin_verb","A") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!

View File

@@ -708,7 +708,7 @@ var/list/admin_verbs_mentor = list(
return
if(holder)
var/new_name = trim_strip_input(src, "Enter new name. Leave blank or as is to cancel.", "Enter new silicon name", S.real_name)
var/new_name = sanitizeSafe(input(src, "Enter new name. Leave blank or as is to cancel.", "Enter new silicon name", S.real_name))
if(new_name && new_name != S.real_name)
admin_log_and_message_admins("has renamed the silicon '[S.real_name]' to '[new_name]'")
S.SetName(new_name)

View File

@@ -2426,9 +2426,7 @@
src.access_news_network()
else if(href_list["ac_set_channel_name"])
src.admincaster_feed_channel.channel_name = strip_html_simple(input(usr, "Provide a Feed Channel Name", "Network Channel Handler", ""))
while (findtext(src.admincaster_feed_channel.channel_name," ") == 1)
src.admincaster_feed_channel.channel_name = copytext(src.admincaster_feed_channel.channel_name,2,lentext(src.admincaster_feed_channel.channel_name)+1)
src.admincaster_feed_channel.channel_name = sanitizeSafe(input(usr, "Provide a Feed Channel Name", "Network Channel Handler", ""))
src.access_news_network()
else if(href_list["ac_set_channel_lock"])
@@ -2461,13 +2459,11 @@
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 = adminscrub(input(usr, "Choose receiving Feed Channel", "Network Channel Handler") in available_channels )
src.admincaster_feed_channel.channel_name = sanitizeSafe(input(usr, "Choose receiving Feed Channel", "Network Channel Handler") in available_channels )
src.access_news_network()
else if(href_list["ac_set_new_message"])
src.admincaster_feed_message.body = adminscrub(input(usr, "Write your Feed story", "Network Channel Handler", ""))
while (findtext(src.admincaster_feed_message.body," ") == 1)
src.admincaster_feed_message.body = copytext(src.admincaster_feed_message.body,2,lentext(src.admincaster_feed_message.body)+1)
src.admincaster_feed_message.body = sanitize(input(usr, "Write your Feed story", "Network Channel Handler", ""))
src.access_news_network()
else if(href_list["ac_submit_new_message"])
@@ -2509,15 +2505,11 @@
src.access_news_network()
else if(href_list["ac_set_wanted_name"])
src.admincaster_feed_message.author = adminscrub(input(usr, "Provide the name of the Wanted person", "Network Security Handler", ""))
while (findtext(src.admincaster_feed_message.author," ") == 1)
src.admincaster_feed_message.author = copytext(admincaster_feed_message.author,2,lentext(admincaster_feed_message.author)+1)
src.admincaster_feed_message.author = sanitize(input(usr, "Provide the name of the Wanted person", "Network Security Handler", ""))
src.access_news_network()
else if(href_list["ac_set_wanted_desc"])
src.admincaster_feed_message.body = adminscrub(input(usr, "Provide the a description of the Wanted person and any other details you deem important", "Network Security Handler", ""))
while (findtext(src.admincaster_feed_message.body," ") == 1)
src.admincaster_feed_message.body = copytext(src.admincaster_feed_message.body,2,lentext(src.admincaster_feed_message.body)+1)
src.admincaster_feed_message.body = sanitize(input(usr, "Provide the a description of the Wanted person and any other details you deem important", "Network Security Handler", ""))
src.access_news_network()
else if(href_list["ac_submit_wanted"])
@@ -2622,7 +2614,7 @@
src.access_news_network()
else if(href_list["ac_set_signature"])
src.admincaster_signature = adminscrub(input(usr, "Provide your desired signature", "Network Identity Handler", ""))
src.admincaster_signature = sanitize(input(usr, "Provide your desired signature", "Network Identity Handler", ""))
src.access_news_network()
else if(href_list["populate_inactive_customitems"])

View File

@@ -1205,7 +1205,7 @@ datum/preferences
if("name")
var/raw_name = input(user, "Choose your character's name:", "Character Preference") as text|null
if (!isnull(raw_name)) // Check to ensure that the user entered text (rather than cancel.)
var/new_name = reject_bad_name(raw_name)
var/new_name = sanitizeName(raw_name)
if(new_name)
real_name = new_name
else

View File

@@ -187,7 +187,7 @@
//Sanitize
metadata = sanitize_text(metadata, initial(metadata))
real_name = reject_bad_name(real_name)
real_name = sanitizeName(real_name)
if(isnull(species) || !(species in playable_species))
species = "Human"

View File

@@ -222,7 +222,7 @@
if("logout")
authenticated = 0
if("filter")
var/filterstr = stripped_input(usr,"Input the search criteria. Multiple values can be input, separated by a comma.", "Filter setting") as text|null
var/filterstr = sanitize(input("Input the search criteria. Multiple values can be input, separated by a comma.", "Filter setting") as text|null)
if(filterstr)
filters[href_list["filter"]] = text2list(filterstr,",")
else
@@ -243,7 +243,7 @@
current = null
if("label")
if(current)
var/label = stripped_input(usr,"Input the label for this record. Multiple values can be input, separated by a comma.", "Labeling record", current.fields["label"]) as text|null
var/label = sanitize(input(usr,"Input the label for this record. Multiple values can be input, separated by a comma.", "Labeling record", current.fields["label"]) as text|null)
current.fields["label"] = label
if("object")
if(scanning)

View File

@@ -31,11 +31,11 @@
O.loc = src
update_icon()
else if(istype(O, /obj/item/weapon/pen))
var/newname = stripped_input(usr, "What would you like to title this bookshelf?")
var/newname = sanitizeSafe(input("What would you like to title this bookshelf?"), MAX_MESSAGE_LEN)
if(!newname)
return
else
name = ("bookcase ([sanitizeSafe(newname)])")
name = ("bookcase ([newname])")
else
..()
@@ -174,7 +174,7 @@
var/choice = input("What would you like to change?") in list("Title", "Contents", "Author", "Cancel")
switch(choice)
if("Title")
var/newtitle = reject_bad_text(stripped_input(usr, "Write a new title:"))
var/newtitle = reject_bad_text(sanitizeSafe(input("Write a new title:")))
if(!newtitle)
usr << "The title is invalid."
return
@@ -182,14 +182,14 @@
src.name = newtitle
src.title = newtitle
if("Contents")
var/content = strip_html(input(usr, "Write your book's contents (HTML NOT allowed):"),8192) as message|null
var/content = sanitize(input("Write your book's contents (HTML NOT allowed):") as message|null, MAX_BOOK_MESSAGE_LEN)
if(!content)
usr << "The content is invalid."
return
else
src.dat += content
if("Author")
var/newauthor = stripped_input(usr, "Write the author's name:")
var/newauthor = sanitize(input(usr, "Write the author's name:"))
if(!newauthor)
usr << "The name is invalid."
return

View File

@@ -533,7 +533,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
var/max_length = 50
var/message = stripped_input(src,"Write a message. It cannot be longer than [max_length] characters.","Blood writing", "")
var/message = sanitize(input("Write a message. It cannot be longer than [max_length] characters.","Blood writing", ""))
if (message)

View File

@@ -1,5 +1,5 @@
/mob/dead/observer/say(var/message)
message = strip_html_properly(message)
message = sanitize(message)
if (!message)
return
@@ -18,7 +18,7 @@
/mob/dead/observer/emote(var/act, var/type, var/message)
message = trim_strip_html_properly(message)
message = sanitize(message)
if(!message)
return

View File

@@ -7,7 +7,7 @@
src << "\red You cannot speak in IC (Muted)."
return
message = trim_strip_html_properly(message)
message = sanitize(message)
if(stat == 2)
return say_dead(message)

View File

@@ -1205,7 +1205,7 @@
var/max_length = bloody_hands * 30 //tweeter style
var/message = stripped_input(src,"Write a message. It cannot be longer than [max_length] characters.","Blood writing", "")
var/message = sanitize(input("Write a message. It cannot be longer than [max_length] characters.","Blood writing", ""))
if (message)
var/used_blood_amount = round(length(message) / 30, 1)

View File

@@ -10,7 +10,7 @@
src << "\red You cannot speak in IC (Muted)."
return
message = trim_strip_html_properly(message)
message = sanitize(message)
if(stat)
if(stat == 2)

View File

@@ -6,7 +6,7 @@
usr << "\red Speech is currently admin-disabled."
return
message = trim_strip_html_properly(message)
message = sanitize(message)
log_whisper("[src.name]/[src.key] : [message]")
if (src.client)

View File

@@ -34,7 +34,7 @@
if (src.client.handle_spam_prevention(message,MUTE_IC))
return 0
message = trim_strip_html_properly(message)
message = sanitize(message)
if (stat == 2)
return say_dead(message)

View File

@@ -14,7 +14,7 @@
if(istype(src.loc,/mob/living/simple_animal/borer))
message = trim_strip_html_properly(message)
message = sanitize(message)
if (!message)
return
log_say("[key_name(src)] : [message]")

View File

@@ -1,6 +1,6 @@
/mob/living/simple_animal/borer/say(var/message)
message = trim_strip_html_properly(message)
message = sanitize(message)
message = capitalize(message)
if(!message)

View File

@@ -36,7 +36,7 @@
usr << "\red Speech is currently admin-disabled."
return
message = strip_html_properly(message)
message = sanitize(message)
set_typing_indicator(0)
if(use_me)

View File

@@ -77,25 +77,25 @@
return 1
if(href_list["change_zeroth_law"])
var/new_law = trim_strip_input(usr, "Enter new law Zero. Leaving the field blank will cancel the edit.", "Edit Law", zeroth_law)
var/new_law = sanitize(input("Enter new law Zero. Leaving the field blank will cancel the edit.", "Edit Law", zeroth_law))
if(new_law && new_law != zeroth_law && can_still_topic())
zeroth_law = new_law
return 1
if(href_list["change_ion_law"])
var/new_law = trim_strip_input(usr, "Enter new ion law. Leaving the field blank will cancel the edit.", "Edit Law", ion_law)
var/new_law = sanitize(input("Enter new ion law. Leaving the field blank will cancel the edit.", "Edit Law", ion_law))
if(new_law && new_law != ion_law && can_still_topic())
ion_law = new_law
return 1
if(href_list["change_inherent_law"])
var/new_law = trim_strip_input(usr, "Enter new inherent law. Leaving the field blank will cancel the edit.", "Edit Law", inherent_law)
var/new_law = sanitize(input("Enter new inherent law. Leaving the field blank will cancel the edit.", "Edit Law", inherent_law))
if(new_law && new_law != inherent_law && can_still_topic())
inherent_law = new_law
return 1
if(href_list["change_supplied_law"])
var/new_law = trim_strip_input(usr, "Enter new supplied law. Leaving the field blank will cancel the edit.", "Edit Law", supplied_law)
var/new_law = sanitize(input("Enter new supplied law. Leaving the field blank will cancel the edit.", "Edit Law", supplied_law))
if(new_law && new_law != supplied_law && can_still_topic())
supplied_law = new_law
return 1
@@ -110,7 +110,7 @@
if(is_malf(usr))
var/datum/ai_law/AL = locate(href_list["edit_law"]) in owner.laws.all_laws()
if(AL)
var/new_law = trim_strip_input(usr, "Enter new law. Leaving the field blank will cancel the edit.", "Edit Law", AL.law)
var/new_law = sanitize(input(usr, "Enter new law. Leaving the field blank will cancel the edit.", "Edit Law", AL.law))
if(new_law && new_law != AL.law && is_malf(usr) && can_still_topic())
log_and_message_admins("has changed a law of [owner] from '[AL.law]' to '[new_law]'")
AL.law = new_law

View File

@@ -130,7 +130,7 @@
if(new_signature)
signature = new_signature
*/
signature = trim_strip_html_properly(input("Enter new signature. Leave blank for 'Anonymous'", "New Signature", signature))
signature = sanitize(input("Enter new signature. Leave blank for 'Anonymous'", "New Signature", signature))
/obj/item/weapon/pen/proc/get_signature(var/mob/user)
return (user && user.real_name) ? user.real_name : "Anonymous"

View File

@@ -22,7 +22,7 @@
M << "<span class='notice'>You don't feel cool enough to name this gun, chump.</span>"
return 0
var/input = stripped_input(usr,"What do you want to name the gun?", ,"", MAX_NAME_LEN)
var/input = sanitizeSafe(input("What do you want to name the gun?", ,""), MAX_NAME_LEN)
if(src && input && !M.stat && in_range(M,src))
name = input

View File

@@ -34,7 +34,7 @@
M << "<span class='notice'>You don't feel cool enough to name this gun, chump.</span>"
return 0
var/input = stripped_input(usr,"What do you want to name the gun?", ,"", MAX_NAME_LEN)
var/input = sanitizeSafe(input("What do you want to name the gun?", ,""), MAX_NAME_LEN)
if(src && input && !M.stat && in_range(M,src))
name = input

View File

@@ -435,7 +435,7 @@
src.updateUsrDialog()
return
else if(href_list["name_disease"])
var/new_name = stripped_input(usr, "Name the Disease", "New Name", "", MAX_NAME_LEN)
var/new_name = sanitizeSafe(input(usr, "Name the Disease", "New Name", ""), MAX_NAME_LEN)
if(stat & (NOPOWER|BROKEN)) return
if(usr.stat || usr.restrained()) return
if(!in_range(src, usr)) return