mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 02:34:00 +00:00
sanitize() refactor: second pass(other sanitize functions)
This commit is contained in:
@@ -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
|
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)
|
if((world.time-time_passed)>300)
|
||||||
return //took too long
|
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)
|
for(var/mob/living/M in player_list)
|
||||||
if(M == src)
|
if(M == src)
|
||||||
|
|||||||
@@ -36,8 +36,8 @@
|
|||||||
var/tmp/message_title = new_title ? new_title : title
|
var/tmp/message_title = new_title ? new_title : title
|
||||||
var/tmp/message_sound = new_sound ? sound(new_sound) : sound
|
var/tmp/message_sound = new_sound ? sound(new_sound) : sound
|
||||||
|
|
||||||
message = trim_strip_html_properly(message)
|
message = sanitize(message, extra = 0)
|
||||||
message_title = html_encode(message_title)
|
message_title = sanitizeSafe(message_title)
|
||||||
|
|
||||||
Message(message, message_title)
|
Message(message, message_title)
|
||||||
if(do_newscast)
|
if(do_newscast)
|
||||||
|
|||||||
@@ -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>"
|
src << "<span class='notice'>We return our vocal glands to their original location.</span>"
|
||||||
return
|
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)
|
if(!mimic_voice)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -564,7 +564,7 @@ var/list/sacrificed = list()
|
|||||||
// returns 0 if the rune is not used. returns 1 if the rune is used.
|
// returns 0 if the rune is not used. returns 1 if the rune is used.
|
||||||
communicate()
|
communicate()
|
||||||
. = 1 // Default output is 1. If the rune is deleted it will return 1
|
. = 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(!input)
|
||||||
if (istype(src))
|
if (istype(src))
|
||||||
fizzle()
|
fizzle()
|
||||||
|
|||||||
@@ -355,7 +355,7 @@ text("<A href='?src=\ref[src];operation=oddbutton'>[src.oddbutton ? "Yes" : "No"
|
|||||||
del(src)
|
del(src)
|
||||||
|
|
||||||
else if (istype(W, /obj/item/weapon/pen))
|
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)
|
if (!t)
|
||||||
return
|
return
|
||||||
if (!in_range(src, usr) && src.loc != usr)
|
if (!in_range(src, usr) && src.loc != usr)
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
..()
|
..()
|
||||||
|
|
||||||
if(istype(W, /obj/item/weapon/pen))
|
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(!t) return
|
||||||
if(!in_range(src, usr) && src.loc != usr) return
|
if(!in_range(src, usr) && src.loc != usr) return
|
||||||
created_name = t
|
created_name = t
|
||||||
|
|||||||
@@ -420,7 +420,7 @@
|
|||||||
del(src)
|
del(src)
|
||||||
|
|
||||||
else if (istype(W, /obj/item/weapon/pen))
|
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)
|
if (!t)
|
||||||
return
|
return
|
||||||
if (!in_range(src, usr) && src.loc != usr)
|
if (!in_range(src, usr) && src.loc != usr)
|
||||||
@@ -439,7 +439,7 @@
|
|||||||
user.drop_from_inventory(src)
|
user.drop_from_inventory(src)
|
||||||
del(src)
|
del(src)
|
||||||
else if (istype(W, /obj/item/weapon/pen))
|
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)
|
if (!t)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -564,7 +564,7 @@
|
|||||||
/obj/item/weapon/firstaid_arm_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
/obj/item/weapon/firstaid_arm_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||||
..()
|
..()
|
||||||
if(istype(W, /obj/item/weapon/pen))
|
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)
|
if (!t)
|
||||||
return
|
return
|
||||||
if (!in_range(src, usr) && src.loc != usr)
|
if (!in_range(src, usr) && src.loc != usr)
|
||||||
|
|||||||
@@ -838,7 +838,7 @@ Auto Patrol: []"},
|
|||||||
del(src)
|
del(src)
|
||||||
|
|
||||||
else if(istype(W, /obj/item/weapon/pen))
|
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)
|
if(!t)
|
||||||
return
|
return
|
||||||
if(!in_range(src, usr) && src.loc != usr)
|
if(!in_range(src, usr) && src.loc != usr)
|
||||||
|
|||||||
@@ -78,7 +78,7 @@
|
|||||||
if(isscrewdriver(W))
|
if(isscrewdriver(W))
|
||||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
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)
|
if(!input)
|
||||||
usr << "No input found please hang up and try your call again."
|
usr << "No input found please hang up and try your call again."
|
||||||
return
|
return
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
|
|
||||||
var/area/camera_area = get_area(src)
|
var/area/camera_area = get_area(src)
|
||||||
var/temptag = "[sanitize(camera_area.name)] ([rand(1, 999)])"
|
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
|
state = 4
|
||||||
var/obj/machinery/camera/C = new(src.loc)
|
var/obj/machinery/camera/C = new(src.loc)
|
||||||
|
|||||||
@@ -222,7 +222,7 @@
|
|||||||
if (is_authenticated())
|
if (is_authenticated())
|
||||||
var/t2 = modify
|
var/t2 = modify
|
||||||
if ((modify == t2 && (in_range(src, usr) || (istype(usr, /mob/living/silicon))) && istype(loc, /turf)))
|
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)
|
if(temp_name)
|
||||||
modify.registered_name = temp_name
|
modify.registered_name = temp_name
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -187,7 +187,7 @@
|
|||||||
if(centcomm_message_cooldown)
|
if(centcomm_message_cooldown)
|
||||||
usr << "\red Arrays recycling. Please stand by."
|
usr << "\red Arrays recycling. Please stand by."
|
||||||
return
|
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)))
|
if(!input || !(usr in view(1,src)))
|
||||||
return
|
return
|
||||||
Centcomm_announce(input, usr)
|
Centcomm_announce(input, usr)
|
||||||
@@ -204,7 +204,7 @@
|
|||||||
if(centcomm_message_cooldown)
|
if(centcomm_message_cooldown)
|
||||||
usr << "\red Arrays recycling. Please stand by."
|
usr << "\red Arrays recycling. Please stand by."
|
||||||
return
|
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)))
|
if(!input || !(usr in view(1,src)))
|
||||||
return
|
return
|
||||||
Syndicate_announce(input, usr)
|
Syndicate_announce(input, usr)
|
||||||
|
|||||||
@@ -114,11 +114,11 @@
|
|||||||
if (href_list["choice"])
|
if (href_list["choice"])
|
||||||
switch(href_list["choice"])
|
switch(href_list["choice"])
|
||||||
if ("giv_name")
|
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)
|
if (nam)
|
||||||
giv_name = nam
|
giv_name = nam
|
||||||
if ("reason")
|
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)
|
if(reas)
|
||||||
reason = reas
|
reason = reas
|
||||||
if ("duration")
|
if ("duration")
|
||||||
|
|||||||
@@ -426,7 +426,7 @@ What a mess.*/
|
|||||||
switch(href_list["field"])
|
switch(href_list["field"])
|
||||||
if("name")
|
if("name")
|
||||||
if (istype(active1, /datum/data/record))
|
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)
|
if (!t1 || active1 != a1)
|
||||||
return
|
return
|
||||||
active1.fields["name"] = t1
|
active1.fields["name"] = t1
|
||||||
|
|||||||
@@ -309,7 +309,7 @@ What a mess.*/
|
|||||||
switch(href_list["field"])
|
switch(href_list["field"])
|
||||||
if("name")
|
if("name")
|
||||||
if (istype(active1, /datum/data/record))
|
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)
|
if ((!( t1 ) || !length(trim(t1)) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon)))) || active1 != a1)
|
||||||
return
|
return
|
||||||
active1.fields["name"] = t1
|
active1.fields["name"] = t1
|
||||||
|
|||||||
@@ -192,7 +192,7 @@
|
|||||||
if(centcomm_message_cooldown)
|
if(centcomm_message_cooldown)
|
||||||
usr << "Arrays recycling. Please stand by."
|
usr << "Arrays recycling. Please stand by."
|
||||||
return
|
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())
|
if(!input || !interactable())
|
||||||
return
|
return
|
||||||
Centcomm_announce(input, usr)
|
Centcomm_announce(input, usr)
|
||||||
@@ -209,7 +209,7 @@
|
|||||||
if(centcomm_message_cooldown)
|
if(centcomm_message_cooldown)
|
||||||
usr << "Arrays recycling. Please stand by."
|
usr << "Arrays recycling. Please stand by."
|
||||||
return
|
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())
|
if(!input || !interactable())
|
||||||
return
|
return
|
||||||
Syndicate_announce(input, usr)
|
Syndicate_announce(input, usr)
|
||||||
|
|||||||
@@ -444,7 +444,7 @@ What a mess.*/
|
|||||||
switch(href_list["field"])
|
switch(href_list["field"])
|
||||||
if("name")
|
if("name")
|
||||||
if (istype(active1, /datum/data/record))
|
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)
|
if ((!( t1 ) || !length(trim(t1)) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon)))) || active1 != a1)
|
||||||
return
|
return
|
||||||
active1.fields["name"] = t1
|
active1.fields["name"] = t1
|
||||||
|
|||||||
@@ -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)))
|
if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
|
||||||
usr.set_machine(src)
|
usr.set_machine(src)
|
||||||
if(href_list["set_channel_name"])
|
if(href_list["set_channel_name"])
|
||||||
src.channel_name = strip_html(input(usr, "Provide a Feed Channel Name", "Network Channel Handler", ""))
|
src.channel_name = sanitizeSafe(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.updateUsrDialog()
|
src.updateUsrDialog()
|
||||||
//src.update_icon()
|
//src.update_icon()
|
||||||
|
|
||||||
@@ -541,9 +539,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
|
|||||||
src.updateUsrDialog()
|
src.updateUsrDialog()
|
||||||
|
|
||||||
else if(href_list["set_new_message"])
|
else if(href_list["set_new_message"])
|
||||||
src.msg = strip_html(input(usr, "Write your Feed story", "Network Channel Handler", ""))
|
src.msg = sanitize(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.updateUsrDialog()
|
src.updateUsrDialog()
|
||||||
|
|
||||||
else if(href_list["set_attachment"])
|
else if(href_list["set_attachment"])
|
||||||
@@ -600,15 +596,11 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
|
|||||||
src.updateUsrDialog()
|
src.updateUsrDialog()
|
||||||
|
|
||||||
else if(href_list["set_wanted_name"])
|
else if(href_list["set_wanted_name"])
|
||||||
src.channel_name = strip_html(input(usr, "Provide the name of the Wanted person", "Network Security Handler", ""))
|
src.channel_name = sanitizeSafe(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.updateUsrDialog()
|
src.updateUsrDialog()
|
||||||
|
|
||||||
else if(href_list["set_wanted_desc"])
|
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", ""))
|
src.msg = sanitize(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.updateUsrDialog()
|
src.updateUsrDialog()
|
||||||
|
|
||||||
else if(href_list["submit_wanted"])
|
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)
|
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>"
|
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
|
else
|
||||||
var/s = strip_html( input(user, "Write something", "Newspaper", "") )
|
var/s = sanitize(input(user, "Write something", "Newspaper", ""))
|
||||||
s = sanitize(s)
|
s = sanitize(s)
|
||||||
if (!s)
|
if (!s)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -284,7 +284,7 @@
|
|||||||
src.log_message("Interfaced with [src_object].")
|
src.log_message("Interfaced with [src_object].")
|
||||||
return STATUS_INTERACTIVE
|
return STATUS_INTERACTIVE
|
||||||
if(src_object in view(2, src))
|
if(src_object in view(2, src))
|
||||||
return STATUS_UPDATE //if they're close enough, allow the occupant to see the screen through the viewport or whatever.
|
return STATUS_UPDATE //if they're close enough, allow the occupant to see the screen through the viewport or whatever.
|
||||||
|
|
||||||
/obj/mecha/proc/melee_action(atom/target)
|
/obj/mecha/proc/melee_action(atom/target)
|
||||||
return
|
return
|
||||||
@@ -1569,8 +1569,8 @@
|
|||||||
return
|
return
|
||||||
if (href_list["change_name"])
|
if (href_list["change_name"])
|
||||||
if(usr != src.occupant) return
|
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)
|
var/newname = sanitizeSafe(input(occupant,"Choose new exosuit name","Rename exosuit",initial(name)) as text, MAX_NAME_LEN)
|
||||||
if(newname && trim(newname))
|
if(newname)
|
||||||
name = newname
|
name = newname
|
||||||
else
|
else
|
||||||
alert(occupant, "nope.avi")
|
alert(occupant, "nope.avi")
|
||||||
|
|||||||
@@ -43,9 +43,9 @@
|
|||||||
var/datum/topic_input/filter = new /datum/topic_input(href,href_list)
|
var/datum/topic_input/filter = new /datum/topic_input(href,href_list)
|
||||||
if(href_list["send_message"])
|
if(href_list["send_message"])
|
||||||
var/obj/item/mecha_parts/mecha_tracking/MT = filter.getObj("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()
|
var/obj/mecha/M = MT.in_mecha()
|
||||||
if(trim(message) && M)
|
if(message && M)
|
||||||
M.occupant_message(message)
|
M.occupant_message(message)
|
||||||
return
|
return
|
||||||
if(href_list["shock"])
|
if(href_list["shock"])
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ move an amendment</a> to the drawing.</p>
|
|||||||
usr << "\red Error! Please notify administration!"
|
usr << "\red Error! Please notify administration!"
|
||||||
return
|
return
|
||||||
var/list/turf/turfs = res
|
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
|
if(!str || !length(str)) //cancel
|
||||||
return
|
return
|
||||||
if(length(str) > 50)
|
if(length(str) > 50)
|
||||||
@@ -154,7 +154,7 @@ move an amendment</a> to the drawing.</p>
|
|||||||
var/area/A = get_area()
|
var/area/A = get_area()
|
||||||
//world << "DEBUG: edit_area"
|
//world << "DEBUG: edit_area"
|
||||||
var/prevname = "[A.name]"
|
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
|
if(!str || !length(str) || str==prevname) //cancel
|
||||||
return
|
return
|
||||||
if(length(str) > 50)
|
if(length(str) > 50)
|
||||||
|
|||||||
@@ -689,7 +689,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
|||||||
if ("Edit")
|
if ("Edit")
|
||||||
var/n = input(U, "Please enter message", name, notehtml) as message
|
var/n = input(U, "Please enter message", name, notehtml) as message
|
||||||
if (in_range(src, U) && loc == U)
|
if (in_range(src, U) && loc == U)
|
||||||
n = copytext(adminscrub(n), 1, MAX_MESSAGE_LEN)
|
n = sanitizeSafe(n, extra = 0)
|
||||||
if (mode == 1)
|
if (mode == 1)
|
||||||
note = html_decode(n)
|
note = html_decode(n)
|
||||||
notehtml = note
|
notehtml = note
|
||||||
@@ -972,7 +972,8 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
|||||||
U.last_target_click = world.time
|
U.last_target_click = world.time
|
||||||
var/t = input(U, "Please enter message", P.name, null) as text
|
var/t = input(U, "Please enter message", P.name, null) as text
|
||||||
t = sanitize(t)
|
t = sanitize(t)
|
||||||
t = readd_quotes(t)
|
//t = readd_quotes(t)
|
||||||
|
t = replace_characters(t, list(""" = "\""))
|
||||||
if (!t || !istype(P))
|
if (!t || !istype(P))
|
||||||
return
|
return
|
||||||
if (!in_range(src, U) && loc != U)
|
if (!in_range(src, U) && loc != U)
|
||||||
|
|||||||
@@ -233,7 +233,7 @@
|
|||||||
user << "\blue The MMI must go in after everything else!"
|
user << "\blue The MMI must go in after everything else!"
|
||||||
|
|
||||||
if (istype(W, /obj/item/weapon/pen))
|
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)
|
if (!t)
|
||||||
return
|
return
|
||||||
if (!in_range(src, usr) && src.loc != usr)
|
if (!in_range(src, usr) && src.loc != usr)
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
var/heldname = "default name"
|
var/heldname = "default name"
|
||||||
|
|
||||||
/obj/item/borg/upgrade/rename/attack_self(mob/user as mob)
|
/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)
|
/obj/item/borg/upgrade/rename/action(var/mob/living/silicon/robot/R)
|
||||||
if(..()) return 0
|
if(..()) return 0
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ AI MODULES
|
|||||||
|
|
||||||
/obj/item/weapon/aiModule/safeguard/attack_self(var/mob/user as mob)
|
/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
|
targetName = targName
|
||||||
desc = text("A 'safeguard' AI module: 'Safeguard []. Individuals that threaten [] are not human and are a threat to humans.'", targetName, targetName)
|
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)
|
/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
|
targetName = targName
|
||||||
desc = text("A 'one human' AI module: 'Only [] is human.'", targetName)
|
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)
|
/obj/item/weapon/aiModule/freeformcore/attack_self(var/mob/user as mob)
|
||||||
..()
|
..()
|
||||||
var/newlaw = ""
|
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
|
newFreeFormLaw = targName
|
||||||
desc = "A 'freeform' Core AI module: '[newFreeFormLaw]'"
|
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)
|
/obj/item/weapon/aiModule/syndicate/attack_self(var/mob/user as mob)
|
||||||
..()
|
..()
|
||||||
var/newlaw = ""
|
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
|
newFreeFormLaw = targName
|
||||||
desc = "A hacked AI law module: '[newFreeFormLaw]'"
|
desc = "A hacked AI law module: '[newFreeFormLaw]'"
|
||||||
|
|
||||||
|
|||||||
@@ -224,7 +224,7 @@
|
|||||||
/obj/item/weapon/card/id/syndicate/attack_self(mob/user as mob)
|
/obj/item/weapon/card/id/syndicate/attack_self(mob/user as mob)
|
||||||
if(!src.registered_name)
|
if(!src.registered_name)
|
||||||
//Stop giving the players unsanitized unputs! You are giving ways for players to intentionally crash clients! -Nodrak
|
//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
|
if(!t) //Same as mob/new_player/prefrences.dm
|
||||||
alert("Invalid name.")
|
alert("Invalid name.")
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
user << "\red Circuit controls are locked."
|
user << "\red Circuit controls are locked."
|
||||||
return
|
return
|
||||||
var/existing_networks = list2text(network,",")
|
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)
|
if(!input)
|
||||||
usr << "No input found please hang up and try your call again."
|
usr << "No input found please hang up and try your call again."
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ Implant Specifics:<BR>"}
|
|||||||
|
|
||||||
hear(var/msg)
|
hear(var/msg)
|
||||||
var/list/replacechars = list("'" = "","\"" = "",">" = "","<" = "","(" = "",")" = "")
|
var/list/replacechars = list("'" = "","\"" = "",">" = "","<" = "","(" = "",")" = "")
|
||||||
msg = sanitize_simple(msg, replacechars)
|
msg = replace_characters(msg, replacechars)
|
||||||
if(findtext(msg,phrase))
|
if(findtext(msg,phrase))
|
||||||
activate()
|
activate()
|
||||||
del(src)
|
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")
|
elevel = alert("What sort of explosion would you prefer?", "Implant Intent", "Localized Limb", "Destroy Body", "Full Explosion")
|
||||||
phrase = input("Choose activation phrase:") as text
|
phrase = input("Choose activation phrase:") as text
|
||||||
var/list/replacechars = list("'" = "","\"" = "",">" = "","<" = "","(" = "",")" = "")
|
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.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."
|
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
|
return 1
|
||||||
|
|||||||
@@ -135,7 +135,7 @@
|
|||||||
|
|
||||||
/obj/structure/door_assembly/attackby(obj/item/W as obj, mob/user as mob)
|
/obj/structure/door_assembly/attackby(obj/item/W as obj, mob/user as mob)
|
||||||
if(istype(W, /obj/item/weapon/pen))
|
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(!t) return
|
||||||
if(!in_range(src, usr) && src.loc != usr) return
|
if(!in_range(src, usr) && src.loc != usr) return
|
||||||
created_name = t
|
created_name = t
|
||||||
|
|||||||
@@ -728,7 +728,7 @@ var/global/floorIsLava = 0
|
|||||||
var/message = input("Global message to send:", "Admin Announce", null, null) as message
|
var/message = input("Global message to send:", "Admin Announce", null, null) as message
|
||||||
if(message)
|
if(message)
|
||||||
if(!check_rights(R_SERVER,0))
|
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]"
|
world << "\blue <b>[usr.client.holder.fakekey ? "Administrator" : usr.key] Announces:</b>\n \t [message]"
|
||||||
log_admin("Announce: [key_name(usr)] : [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!
|
feedback_add_details("admin_verb","A") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||||
|
|||||||
@@ -708,7 +708,7 @@ var/list/admin_verbs_mentor = list(
|
|||||||
return
|
return
|
||||||
|
|
||||||
if(holder)
|
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)
|
if(new_name && new_name != S.real_name)
|
||||||
admin_log_and_message_admins("has renamed the silicon '[S.real_name]' to '[new_name]'")
|
admin_log_and_message_admins("has renamed the silicon '[S.real_name]' to '[new_name]'")
|
||||||
S.SetName(new_name)
|
S.SetName(new_name)
|
||||||
|
|||||||
@@ -2426,9 +2426,7 @@
|
|||||||
src.access_news_network()
|
src.access_news_network()
|
||||||
|
|
||||||
else if(href_list["ac_set_channel_name"])
|
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", ""))
|
src.admincaster_feed_channel.channel_name = sanitizeSafe(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.access_news_network()
|
src.access_news_network()
|
||||||
|
|
||||||
else if(href_list["ac_set_channel_lock"])
|
else if(href_list["ac_set_channel_lock"])
|
||||||
@@ -2461,13 +2459,11 @@
|
|||||||
var/list/available_channels = list()
|
var/list/available_channels = list()
|
||||||
for(var/datum/feed_channel/F in news_network.network_channels)
|
for(var/datum/feed_channel/F in news_network.network_channels)
|
||||||
available_channels += F.channel_name
|
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()
|
src.access_news_network()
|
||||||
|
|
||||||
else if(href_list["ac_set_new_message"])
|
else if(href_list["ac_set_new_message"])
|
||||||
src.admincaster_feed_message.body = adminscrub(input(usr, "Write your Feed story", "Network Channel Handler", ""))
|
src.admincaster_feed_message.body = sanitize(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.access_news_network()
|
src.access_news_network()
|
||||||
|
|
||||||
else if(href_list["ac_submit_new_message"])
|
else if(href_list["ac_submit_new_message"])
|
||||||
@@ -2509,15 +2505,11 @@
|
|||||||
src.access_news_network()
|
src.access_news_network()
|
||||||
|
|
||||||
else if(href_list["ac_set_wanted_name"])
|
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", ""))
|
src.admincaster_feed_message.author = sanitize(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.access_news_network()
|
src.access_news_network()
|
||||||
|
|
||||||
else if(href_list["ac_set_wanted_desc"])
|
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", ""))
|
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", ""))
|
||||||
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.access_news_network()
|
src.access_news_network()
|
||||||
|
|
||||||
else if(href_list["ac_submit_wanted"])
|
else if(href_list["ac_submit_wanted"])
|
||||||
@@ -2622,7 +2614,7 @@
|
|||||||
src.access_news_network()
|
src.access_news_network()
|
||||||
|
|
||||||
else if(href_list["ac_set_signature"])
|
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()
|
src.access_news_network()
|
||||||
|
|
||||||
else if(href_list["populate_inactive_customitems"])
|
else if(href_list["populate_inactive_customitems"])
|
||||||
|
|||||||
@@ -1205,7 +1205,7 @@ datum/preferences
|
|||||||
if("name")
|
if("name")
|
||||||
var/raw_name = input(user, "Choose your character's name:", "Character Preference") as text|null
|
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.)
|
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)
|
if(new_name)
|
||||||
real_name = new_name
|
real_name = new_name
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -187,7 +187,7 @@
|
|||||||
|
|
||||||
//Sanitize
|
//Sanitize
|
||||||
metadata = sanitize_text(metadata, initial(metadata))
|
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))
|
if(isnull(species) || !(species in playable_species))
|
||||||
species = "Human"
|
species = "Human"
|
||||||
|
|||||||
@@ -222,7 +222,7 @@
|
|||||||
if("logout")
|
if("logout")
|
||||||
authenticated = 0
|
authenticated = 0
|
||||||
if("filter")
|
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)
|
if(filterstr)
|
||||||
filters[href_list["filter"]] = text2list(filterstr,",")
|
filters[href_list["filter"]] = text2list(filterstr,",")
|
||||||
else
|
else
|
||||||
@@ -243,7 +243,7 @@
|
|||||||
current = null
|
current = null
|
||||||
if("label")
|
if("label")
|
||||||
if(current)
|
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
|
current.fields["label"] = label
|
||||||
if("object")
|
if("object")
|
||||||
if(scanning)
|
if(scanning)
|
||||||
|
|||||||
@@ -31,11 +31,11 @@
|
|||||||
O.loc = src
|
O.loc = src
|
||||||
update_icon()
|
update_icon()
|
||||||
else if(istype(O, /obj/item/weapon/pen))
|
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)
|
if(!newname)
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
name = ("bookcase ([sanitizeSafe(newname)])")
|
name = ("bookcase ([newname])")
|
||||||
else
|
else
|
||||||
..()
|
..()
|
||||||
|
|
||||||
@@ -174,7 +174,7 @@
|
|||||||
var/choice = input("What would you like to change?") in list("Title", "Contents", "Author", "Cancel")
|
var/choice = input("What would you like to change?") in list("Title", "Contents", "Author", "Cancel")
|
||||||
switch(choice)
|
switch(choice)
|
||||||
if("Title")
|
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)
|
if(!newtitle)
|
||||||
usr << "The title is invalid."
|
usr << "The title is invalid."
|
||||||
return
|
return
|
||||||
@@ -182,14 +182,14 @@
|
|||||||
src.name = newtitle
|
src.name = newtitle
|
||||||
src.title = newtitle
|
src.title = newtitle
|
||||||
if("Contents")
|
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)
|
if(!content)
|
||||||
usr << "The content is invalid."
|
usr << "The content is invalid."
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
src.dat += content
|
src.dat += content
|
||||||
if("Author")
|
if("Author")
|
||||||
var/newauthor = stripped_input(usr, "Write the author's name:")
|
var/newauthor = sanitize(input(usr, "Write the author's name:"))
|
||||||
if(!newauthor)
|
if(!newauthor)
|
||||||
usr << "The name is invalid."
|
usr << "The name is invalid."
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -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/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)
|
if (message)
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/mob/dead/observer/say(var/message)
|
/mob/dead/observer/say(var/message)
|
||||||
message = strip_html_properly(message)
|
message = sanitize(message)
|
||||||
|
|
||||||
if (!message)
|
if (!message)
|
||||||
return
|
return
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/mob/dead/observer/emote(var/act, var/type, var/message)
|
/mob/dead/observer/emote(var/act, var/type, var/message)
|
||||||
message = trim_strip_html_properly(message)
|
message = sanitize(message)
|
||||||
|
|
||||||
if(!message)
|
if(!message)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
src << "\red You cannot speak in IC (Muted)."
|
src << "\red You cannot speak in IC (Muted)."
|
||||||
return
|
return
|
||||||
|
|
||||||
message = trim_strip_html_properly(message)
|
message = sanitize(message)
|
||||||
|
|
||||||
if(stat == 2)
|
if(stat == 2)
|
||||||
return say_dead(message)
|
return say_dead(message)
|
||||||
|
|||||||
@@ -1205,7 +1205,7 @@
|
|||||||
|
|
||||||
var/max_length = bloody_hands * 30 //tweeter style
|
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)
|
if (message)
|
||||||
var/used_blood_amount = round(length(message) / 30, 1)
|
var/used_blood_amount = round(length(message) / 30, 1)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
src << "\red You cannot speak in IC (Muted)."
|
src << "\red You cannot speak in IC (Muted)."
|
||||||
return
|
return
|
||||||
|
|
||||||
message = trim_strip_html_properly(message)
|
message = sanitize(message)
|
||||||
|
|
||||||
if(stat)
|
if(stat)
|
||||||
if(stat == 2)
|
if(stat == 2)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
usr << "\red Speech is currently admin-disabled."
|
usr << "\red Speech is currently admin-disabled."
|
||||||
return
|
return
|
||||||
|
|
||||||
message = trim_strip_html_properly(message)
|
message = sanitize(message)
|
||||||
log_whisper("[src.name]/[src.key] : [message]")
|
log_whisper("[src.name]/[src.key] : [message]")
|
||||||
|
|
||||||
if (src.client)
|
if (src.client)
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
if (src.client.handle_spam_prevention(message,MUTE_IC))
|
if (src.client.handle_spam_prevention(message,MUTE_IC))
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
message = trim_strip_html_properly(message)
|
message = sanitize(message)
|
||||||
|
|
||||||
if (stat == 2)
|
if (stat == 2)
|
||||||
return say_dead(message)
|
return say_dead(message)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
if(istype(src.loc,/mob/living/simple_animal/borer))
|
if(istype(src.loc,/mob/living/simple_animal/borer))
|
||||||
|
|
||||||
message = trim_strip_html_properly(message)
|
message = sanitize(message)
|
||||||
if (!message)
|
if (!message)
|
||||||
return
|
return
|
||||||
log_say("[key_name(src)] : [message]")
|
log_say("[key_name(src)] : [message]")
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/mob/living/simple_animal/borer/say(var/message)
|
/mob/living/simple_animal/borer/say(var/message)
|
||||||
|
|
||||||
message = trim_strip_html_properly(message)
|
message = sanitize(message)
|
||||||
message = capitalize(message)
|
message = capitalize(message)
|
||||||
|
|
||||||
if(!message)
|
if(!message)
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
usr << "\red Speech is currently admin-disabled."
|
usr << "\red Speech is currently admin-disabled."
|
||||||
return
|
return
|
||||||
|
|
||||||
message = strip_html_properly(message)
|
message = sanitize(message)
|
||||||
|
|
||||||
set_typing_indicator(0)
|
set_typing_indicator(0)
|
||||||
if(use_me)
|
if(use_me)
|
||||||
|
|||||||
@@ -77,25 +77,25 @@
|
|||||||
return 1
|
return 1
|
||||||
|
|
||||||
if(href_list["change_zeroth_law"])
|
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())
|
if(new_law && new_law != zeroth_law && can_still_topic())
|
||||||
zeroth_law = new_law
|
zeroth_law = new_law
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
if(href_list["change_ion_law"])
|
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())
|
if(new_law && new_law != ion_law && can_still_topic())
|
||||||
ion_law = new_law
|
ion_law = new_law
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
if(href_list["change_inherent_law"])
|
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())
|
if(new_law && new_law != inherent_law && can_still_topic())
|
||||||
inherent_law = new_law
|
inherent_law = new_law
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
if(href_list["change_supplied_law"])
|
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())
|
if(new_law && new_law != supplied_law && can_still_topic())
|
||||||
supplied_law = new_law
|
supplied_law = new_law
|
||||||
return 1
|
return 1
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
if(is_malf(usr))
|
if(is_malf(usr))
|
||||||
var/datum/ai_law/AL = locate(href_list["edit_law"]) in owner.laws.all_laws()
|
var/datum/ai_law/AL = locate(href_list["edit_law"]) in owner.laws.all_laws()
|
||||||
if(AL)
|
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())
|
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]'")
|
log_and_message_admins("has changed a law of [owner] from '[AL.law]' to '[new_law]'")
|
||||||
AL.law = new_law
|
AL.law = new_law
|
||||||
|
|||||||
@@ -130,7 +130,7 @@
|
|||||||
if(new_signature)
|
if(new_signature)
|
||||||
signature = 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)
|
/obj/item/weapon/pen/proc/get_signature(var/mob/user)
|
||||||
return (user && user.real_name) ? user.real_name : "Anonymous"
|
return (user && user.real_name) ? user.real_name : "Anonymous"
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
M << "<span class='notice'>You don't feel cool enough to name this gun, chump.</span>"
|
M << "<span class='notice'>You don't feel cool enough to name this gun, chump.</span>"
|
||||||
return 0
|
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))
|
if(src && input && !M.stat && in_range(M,src))
|
||||||
name = input
|
name = input
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
M << "<span class='notice'>You don't feel cool enough to name this gun, chump.</span>"
|
M << "<span class='notice'>You don't feel cool enough to name this gun, chump.</span>"
|
||||||
return 0
|
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))
|
if(src && input && !M.stat && in_range(M,src))
|
||||||
name = input
|
name = input
|
||||||
|
|||||||
@@ -435,7 +435,7 @@
|
|||||||
src.updateUsrDialog()
|
src.updateUsrDialog()
|
||||||
return
|
return
|
||||||
else if(href_list["name_disease"])
|
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(stat & (NOPOWER|BROKEN)) return
|
||||||
if(usr.stat || usr.restrained()) return
|
if(usr.stat || usr.restrained()) return
|
||||||
if(!in_range(src, usr)) return
|
if(!in_range(src, usr)) return
|
||||||
|
|||||||
Reference in New Issue
Block a user