mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-30 15:38:02 +01:00
Merge pull request #8380 from volas/sanitize_procs
[DNM] sanitize() and text.dm refactoring
This commit is contained in:
@@ -592,13 +592,13 @@ datum/proc/dd_SortValue()
|
||||
return "[src]"
|
||||
|
||||
/obj/machinery/dd_SortValue()
|
||||
return "[sanitize(name)]"
|
||||
return "[sanitize_old(name)]"
|
||||
|
||||
/obj/machinery/camera/dd_SortValue()
|
||||
return "[c_tag]"
|
||||
|
||||
/datum/alarm/dd_SortValue()
|
||||
return "[sanitize(last_name)]"
|
||||
return "[sanitize_old(last_name)]"
|
||||
|
||||
//creates every subtype of prototype (excluding prototype) and adds it to list L.
|
||||
//if no list/L is provided, one is created.
|
||||
|
||||
+104
-183
@@ -22,46 +22,103 @@
|
||||
* Text sanitization
|
||||
*/
|
||||
|
||||
//Simply removes < and > and limits the length of the message
|
||||
/proc/strip_html_simple(var/t,var/limit=MAX_MESSAGE_LEN)
|
||||
var/list/strip_chars = list("<",">")
|
||||
t = copytext(t,1,limit)
|
||||
for(var/char in strip_chars)
|
||||
var/index = findtext(t, char)
|
||||
while(index)
|
||||
t = copytext(t, 1, index) + copytext(t, index+1)
|
||||
index = findtext(t, char)
|
||||
return t
|
||||
//Used for preprocessing entered text
|
||||
/proc/sanitize(var/input, var/max_length = MAX_MESSAGE_LEN, var/encode = 1, var/trim = 1, var/extra = 1)
|
||||
if(!input)
|
||||
return
|
||||
|
||||
//Removes a few problematic characters
|
||||
/proc/sanitize_simple(var/t,var/list/repl_chars = list("\n"="#","\t"="#"))
|
||||
for(var/char in repl_chars)
|
||||
t = replacetext(t, char, repl_chars[char])
|
||||
return t
|
||||
if(max_length)
|
||||
input = copytext(input,1,max_length)
|
||||
|
||||
/proc/readd_quotes(var/t)
|
||||
var/list/repl_chars = list(""" = "\"")
|
||||
for(var/char in repl_chars)
|
||||
var/index = findtext(t, char)
|
||||
while(index)
|
||||
t = copytext(t, 1, index) + repl_chars[char] + copytext(t, index+5)
|
||||
index = findtext(t, char)
|
||||
return t
|
||||
if(extra)
|
||||
input = replace_characters(input, list("\n"=" ","\t"=" "))
|
||||
|
||||
//Runs byond's sanitization proc along-side sanitize_simple
|
||||
/proc/sanitize(var/t,var/list/repl_chars = null)
|
||||
return html_encode(sanitize_simple(t,repl_chars))
|
||||
if(encode)
|
||||
//In addition to processing html, html_encode removes byond formatting codes like "\red", "\i" and other.
|
||||
//It is important to avoid double-encode text, it can "break" quotes and some other characters.
|
||||
//Also, keep in mind that escaped characters don't work in the interface (window titles, lower left corner of the main window, etc.)
|
||||
input = html_encode(input)
|
||||
else
|
||||
//If not need encode text, simply remove < and >
|
||||
//note: we can also remove here byond formatting codes: 0xFF + next byte
|
||||
input = replace_characters(input, list("<"=" ", ">"=" "))
|
||||
|
||||
//Runs sanitize and strip_html_simple
|
||||
//I believe strip_html_simple() is required to run first to prevent '<' from displaying as '<' after sanitize() calls byond's html_encode()
|
||||
/proc/strip_html(var/t,var/limit=MAX_MESSAGE_LEN)
|
||||
return copytext((sanitize(strip_html_simple(t))),1,limit)
|
||||
if(trim)
|
||||
//Maybe, we need trim text twice? Here and before copytext?
|
||||
input = trim(input)
|
||||
|
||||
//Runs byond's sanitization proc along-side strip_html_simple
|
||||
//I believe strip_html_simple() is required to run first to prevent '<' from displaying as '<' that html_encode() would cause
|
||||
/proc/adminscrub(var/t,var/limit=MAX_MESSAGE_LEN)
|
||||
return copytext((html_encode(strip_html_simple(t))),1,limit)
|
||||
return input
|
||||
|
||||
//Run sanitize(), but remove <, >, " first to prevent displaying them as > < &34; in some places, after html_encode().
|
||||
//Best used for sanitize object names, window titles.
|
||||
//If you have a problem with sanitize() in chat, when quotes and >, < are displayed as html entites -
|
||||
//this is a problem of double-encode(when & becomes &), use sanitize() with encode=0, but not the sanitizeSafe()!
|
||||
/proc/sanitizeSafe(var/input, var/max_length = MAX_MESSAGE_LEN, var/encode = 1, var/trim = 1, var/extra = 1)
|
||||
return sanitize(replace_characters(input, list(">"=" ","<"=" ", "\""="'"), max_length, encode, trim, extra))
|
||||
|
||||
//Filters out undesirable characters from names
|
||||
/proc/sanitizeName(var/input, var/max_length = MAX_NAME_LEN, var/allow_numbers = 0)
|
||||
if(!input || length(input) > max_length)
|
||||
return //Rejects the input if it is null or if it is longer then the max length allowed
|
||||
|
||||
var/number_of_alphanumeric = 0
|
||||
var/last_char_group = 0
|
||||
var/output = ""
|
||||
|
||||
for(var/i=1, i<=length(input), i++)
|
||||
var/ascii_char = text2ascii(input,i)
|
||||
switch(ascii_char)
|
||||
// A .. Z
|
||||
if(65 to 90) //Uppercase Letters
|
||||
output += ascii2text(ascii_char)
|
||||
number_of_alphanumeric++
|
||||
last_char_group = 4
|
||||
|
||||
// a .. z
|
||||
if(97 to 122) //Lowercase Letters
|
||||
if(last_char_group<2) output += ascii2text(ascii_char-32) //Force uppercase first character
|
||||
else output += ascii2text(ascii_char)
|
||||
number_of_alphanumeric++
|
||||
last_char_group = 4
|
||||
|
||||
// 0 .. 9
|
||||
if(48 to 57) //Numbers
|
||||
if(!last_char_group) continue //suppress at start of string
|
||||
if(!allow_numbers) continue
|
||||
output += ascii2text(ascii_char)
|
||||
number_of_alphanumeric++
|
||||
last_char_group = 3
|
||||
|
||||
// ' - .
|
||||
if(39,45,46) //Common name punctuation
|
||||
if(!last_char_group) continue
|
||||
output += ascii2text(ascii_char)
|
||||
last_char_group = 2
|
||||
|
||||
// ~ | @ : # $ % & * +
|
||||
if(126,124,64,58,35,36,37,38,42,43) //Other symbols that we'll allow (mainly for AI)
|
||||
if(!last_char_group) continue //suppress at start of string
|
||||
if(!allow_numbers) continue
|
||||
output += ascii2text(ascii_char)
|
||||
last_char_group = 2
|
||||
|
||||
//Space
|
||||
if(32)
|
||||
if(last_char_group <= 1) continue //suppress double-spaces and spaces at start of string
|
||||
output += ascii2text(ascii_char)
|
||||
last_char_group = 1
|
||||
else
|
||||
return
|
||||
|
||||
if(number_of_alphanumeric < 2) return //protects against tiny names like "A" and also names like "' ' ' ' ' ' ' '"
|
||||
|
||||
if(last_char_group == 1)
|
||||
output = copytext(output,1,length(output)) //removes the last character (in this case a space)
|
||||
|
||||
for(var/bad_name in list("space","floor","wall","r-wall","monkey","unknown","inactive ai")) //prevents these common metagamey names
|
||||
if(cmptext(output,bad_name)) return //(not case sensitive)
|
||||
|
||||
return output
|
||||
|
||||
//Returns null if there is any bad text in the string
|
||||
/proc/reject_bad_text(var/text, var/max_length=512)
|
||||
@@ -76,97 +133,11 @@
|
||||
else non_whitespace = 1
|
||||
if(non_whitespace) return text //only accepts the text if it has some non-spaces
|
||||
|
||||
// Used to get a properly sanitized input, of max_length
|
||||
/proc/stripped_input(var/mob/user, var/message = "", var/title = "", var/default = "", var/max_length=MAX_MESSAGE_LEN)
|
||||
var/name = input(user, message, title, default)
|
||||
return strip_html_properly(name, max_length)
|
||||
|
||||
// Used to get a trimmed, properly sanitized input, of max_length
|
||||
/proc/trim_strip_input(var/mob/user, var/message = "", var/title = "", var/default = "", var/max_length=MAX_MESSAGE_LEN)
|
||||
return trim(stripped_input(user, message, title, default, max_length))
|
||||
//Old variant. Haven't dared to replace in some places.
|
||||
/proc/sanitize_old(var/t,var/list/repl_chars = list("\n"="#","\t"="#"))
|
||||
return html_encode(replace_characters(t,repl_chars))
|
||||
|
||||
//Filters out undesirable characters from names
|
||||
/proc/reject_bad_name(var/t_in, var/allow_numbers=0, var/max_length=MAX_NAME_LEN)
|
||||
if(!t_in || length(t_in) > max_length)
|
||||
return //Rejects the input if it is null or if it is longer then the max length allowed
|
||||
|
||||
var/number_of_alphanumeric = 0
|
||||
var/last_char_group = 0
|
||||
var/t_out = ""
|
||||
|
||||
for(var/i=1, i<=length(t_in), i++)
|
||||
var/ascii_char = text2ascii(t_in,i)
|
||||
switch(ascii_char)
|
||||
// A .. Z
|
||||
if(65 to 90) //Uppercase Letters
|
||||
t_out += ascii2text(ascii_char)
|
||||
number_of_alphanumeric++
|
||||
last_char_group = 4
|
||||
|
||||
// a .. z
|
||||
if(97 to 122) //Lowercase Letters
|
||||
if(last_char_group<2) t_out += ascii2text(ascii_char-32) //Force uppercase first character
|
||||
else t_out += ascii2text(ascii_char)
|
||||
number_of_alphanumeric++
|
||||
last_char_group = 4
|
||||
|
||||
// 0 .. 9
|
||||
if(48 to 57) //Numbers
|
||||
if(!last_char_group) continue //suppress at start of string
|
||||
if(!allow_numbers) continue
|
||||
t_out += ascii2text(ascii_char)
|
||||
number_of_alphanumeric++
|
||||
last_char_group = 3
|
||||
|
||||
// ' - .
|
||||
if(39,45,46) //Common name punctuation
|
||||
if(!last_char_group) continue
|
||||
t_out += ascii2text(ascii_char)
|
||||
last_char_group = 2
|
||||
|
||||
// ~ | @ : # $ % & * +
|
||||
if(126,124,64,58,35,36,37,38,42,43) //Other symbols that we'll allow (mainly for AI)
|
||||
if(!last_char_group) continue //suppress at start of string
|
||||
if(!allow_numbers) continue
|
||||
t_out += ascii2text(ascii_char)
|
||||
last_char_group = 2
|
||||
|
||||
//Space
|
||||
if(32)
|
||||
if(last_char_group <= 1) continue //suppress double-spaces and spaces at start of string
|
||||
t_out += ascii2text(ascii_char)
|
||||
last_char_group = 1
|
||||
else
|
||||
return
|
||||
|
||||
if(number_of_alphanumeric < 2) return //protects against tiny names like "A" and also names like "' ' ' ' ' ' ' '"
|
||||
|
||||
if(last_char_group == 1)
|
||||
t_out = copytext(t_out,1,length(t_out)) //removes the last character (in this case a space)
|
||||
|
||||
for(var/bad_name in list("space","floor","wall","r-wall","monkey","unknown","inactive ai")) //prevents these common metagamey names
|
||||
if(cmptext(t_out,bad_name)) return //(not case sensitive)
|
||||
|
||||
return t_out
|
||||
|
||||
//checks text for html tags
|
||||
//if tag is not in whitelist (var/list/paper_tag_whitelist in global.dm)
|
||||
//relpaces < with <
|
||||
proc/checkhtml(var/t)
|
||||
t = sanitize_simple(t, list("&#"="."))
|
||||
var/p = findtext(t,"<",1)
|
||||
while (p) //going through all the tags
|
||||
var/start = p++
|
||||
var/tag = copytext(t,p, p+1)
|
||||
if (tag != "/")
|
||||
while (reject_bad_text(copytext(t, p, p+1), 1))
|
||||
tag = copytext(t,start, p)
|
||||
p++
|
||||
tag = copytext(t,start+1, p)
|
||||
if (!(tag in paper_tag_whitelist)) //if it's unkown tag, disarming it
|
||||
t = copytext(t,1,start-1) + "<" + copytext(t,start+1)
|
||||
p = findtext(t,"<",p)
|
||||
return t
|
||||
/*
|
||||
* Text searches
|
||||
*/
|
||||
@@ -203,12 +174,18 @@ proc/checkhtml(var/t)
|
||||
/*
|
||||
* Text modification
|
||||
*/
|
||||
|
||||
/proc/replacetext(text, find, replacement)
|
||||
return list2text(text2list(text, find), replacement)
|
||||
|
||||
/proc/replacetextEx(text, find, replacement)
|
||||
return list2text(text2listEx(text, find), replacement)
|
||||
|
||||
/proc/replace_characters(var/t,var/list/repl_chars)
|
||||
for(var/char in repl_chars)
|
||||
replacetext(t, char, repl_chars[char])
|
||||
return t
|
||||
|
||||
//Adds 'u' number of zeros ahead of the text 't'
|
||||
/proc/add_zero(t, u)
|
||||
while (length(t) < u)
|
||||
@@ -239,7 +216,6 @@ proc/checkhtml(var/t)
|
||||
for (var/i = length(text), i > 0, i--)
|
||||
if (text2ascii(text, i) > 32)
|
||||
return copytext(text, 1, i + 1)
|
||||
|
||||
return ""
|
||||
|
||||
//Returns a string with reserved characters and spaces before the first word and after the last word removed.
|
||||
@@ -250,43 +226,18 @@ proc/checkhtml(var/t)
|
||||
/proc/capitalize(var/t as text)
|
||||
return uppertext(copytext(t, 1, 2)) + copytext(t, 2)
|
||||
|
||||
//Centers text by adding spaces to either side of the string.
|
||||
/proc/dd_centertext(message, length)
|
||||
var/new_message = message
|
||||
var/size = length(message)
|
||||
var/delta = length - size
|
||||
if(size == length)
|
||||
return new_message
|
||||
if(size > length)
|
||||
return copytext(new_message, 1, length + 1)
|
||||
if(delta == 1)
|
||||
return new_message + " "
|
||||
if(delta % 2)
|
||||
new_message = " " + new_message
|
||||
delta--
|
||||
var/spaces = add_lspace("",delta/2-1)
|
||||
return spaces + new_message + spaces
|
||||
|
||||
//Limits the length of the text. Note: MAX_MESSAGE_LEN and MAX_NAME_LEN are widely used for this purpose
|
||||
/proc/dd_limittext(message, length)
|
||||
var/size = length(message)
|
||||
if(size <= length)
|
||||
return message
|
||||
return copytext(message, 1, length + 1)
|
||||
|
||||
|
||||
/proc/stringmerge(var/text,var/compare,replace = "*")
|
||||
//This proc fills in all spaces with the "replace" var (* by default) with whatever
|
||||
//is in the other string at the same spot (assuming it is not a replace char).
|
||||
//This is used for fingerprints
|
||||
/proc/stringmerge(var/text,var/compare,replace = "*")
|
||||
var/newtext = text
|
||||
if(lentext(text) != lentext(compare))
|
||||
return 0
|
||||
for(var/i = 1, i < lentext(text), i++)
|
||||
var/a = copytext(text,i,i+1)
|
||||
var/b = copytext(compare,i,i+1)
|
||||
//if it isn't both the same letter, or if they are both the replacement character
|
||||
//(no way to know what it was supposed to be)
|
||||
//if it isn't both the same letter, or if they are both the replacement character
|
||||
//(no way to know what it was supposed to be)
|
||||
if(a != b)
|
||||
if(a == replace) //if A is the replacement char
|
||||
newtext = copytext(newtext,1,i) + b + copytext(newtext, i+1)
|
||||
@@ -296,9 +247,9 @@ proc/checkhtml(var/t)
|
||||
return 0
|
||||
return newtext
|
||||
|
||||
/proc/stringpercent(var/text,character = "*")
|
||||
//This proc returns the number of chars of the string that is the character
|
||||
//This is used for detective work to determine fingerprint completion.
|
||||
/proc/stringpercent(var/text,character = "*")
|
||||
if(!text || !character)
|
||||
return 0
|
||||
var/count = 0
|
||||
@@ -325,36 +276,6 @@ proc/TextPreview(var/string,var/len=40)
|
||||
else
|
||||
return "[copytext(string, 1, 37)]..."
|
||||
|
||||
//This proc strips html properly, but it's not lazy like the other procs.
|
||||
//This means that it doesn't just remove < and > and call it a day.
|
||||
//Also limit the size of the input, if specified.
|
||||
/proc/strip_html_properly(var/input, var/max_length = MAX_MESSAGE_LEN)
|
||||
if(!input)
|
||||
return
|
||||
var/opentag = 1 //These store the position of < and > respectively.
|
||||
var/closetag = 1
|
||||
while(1)
|
||||
opentag = findtext(input, "<")
|
||||
closetag = findtext(input, ">")
|
||||
if(closetag && opentag)
|
||||
if(closetag < opentag)
|
||||
input = copytext(input, (closetag + 1))
|
||||
else
|
||||
input = copytext(input, 1, opentag) + copytext(input, (closetag + 1))
|
||||
else if(closetag || opentag)
|
||||
if(opentag)
|
||||
input = copytext(input, 1, opentag)
|
||||
else
|
||||
input = copytext(input, (closetag + 1))
|
||||
else
|
||||
break
|
||||
if(max_length)
|
||||
input = copytext(input,1,max_length)
|
||||
return sanitize(input)
|
||||
|
||||
/proc/trim_strip_html_properly(var/input, var/max_length = MAX_MESSAGE_LEN)
|
||||
return trim(strip_html_properly(input, max_length))
|
||||
|
||||
//For generating neat chat tag-images
|
||||
//The icon var could be local in the proc, but it's a waste of resources
|
||||
// to always create it and then throw it out.
|
||||
|
||||
@@ -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)>3000)
|
||||
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)
|
||||
|
||||
@@ -241,10 +241,10 @@ datum/controller/vote
|
||||
choices.Add(antag.role_text)
|
||||
choices.Add("None")
|
||||
if("custom")
|
||||
question = html_encode(input(usr,"What is the vote for?") as text|null)
|
||||
question = sanitizeSafe(input(usr,"What is the vote for?") as text|null)
|
||||
if(!question) return 0
|
||||
for(var/i=1,i<=10,i++)
|
||||
var/option = capitalize(html_encode(input(usr,"Please enter an option or hit cancel to finish") as text|null))
|
||||
var/option = capitalize(sanitize(input(usr,"Please enter an option or hit cancel to finish") as text|null))
|
||||
if(!option || mode || !usr.client) break
|
||||
choices.Add(option)
|
||||
else
|
||||
|
||||
@@ -427,7 +427,7 @@ client
|
||||
usr << "This can only be used on instances of type /mob"
|
||||
return
|
||||
|
||||
var/new_name = sanitize(copytext(input(usr,"What would you like to name this mob?","Input a name",M.real_name) as text|null,1,MAX_NAME_LEN))
|
||||
var/new_name = sanitize(input(usr,"What would you like to name this mob?","Input a name",M.real_name) as text|null, MAX_NAME_LEN)
|
||||
if( !new_name || !M ) return
|
||||
|
||||
message_admins("Admin [key_name_admin(usr)] renamed [key_name_admin(M)] to [new_name].")
|
||||
@@ -875,7 +875,7 @@ client
|
||||
return
|
||||
|
||||
if(organ_slot != "default")
|
||||
organ_slot = sanitize(copytext(organ_slot,1,MAX_MESSAGE_LEN))
|
||||
organ_slot = sanitize(organ_slot)
|
||||
else
|
||||
if(I.removed_type)
|
||||
var/obj/item/organ/O = new I.removed_type()
|
||||
|
||||
@@ -394,7 +394,7 @@ var/list/advance_cures = list(
|
||||
|
||||
if(D.symptoms.len > 0)
|
||||
|
||||
var/new_name = input(user, "Name your new disease.", "New Name")
|
||||
var/new_name = sanitizeSafe(input(user, "Name your new disease.", "New Name"), MAX_NAME_LEN)
|
||||
D.AssignName(new_name)
|
||||
D.Refresh()
|
||||
|
||||
|
||||
+2
-2
@@ -166,7 +166,7 @@ datum/mind
|
||||
assigned_role = new_role
|
||||
|
||||
else if (href_list["memory_edit"])
|
||||
var/new_memo = sanitize(copytext(input("Write new memory", "Memory", memory) as null|message,1,MAX_MESSAGE_LEN))
|
||||
var/new_memo = sanitize(input("Write new memory", "Memory", memory) as null|message)
|
||||
if (isnull(new_memo)) return
|
||||
memory = new_memo
|
||||
|
||||
@@ -277,7 +277,7 @@ datum/mind
|
||||
new_objective.target_amount = target_number
|
||||
|
||||
if ("custom")
|
||||
var/expl = sanitize(copytext(input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null,1,MAX_MESSAGE_LEN))
|
||||
var/expl = sanitize(input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null)
|
||||
if (!expl) return
|
||||
new_objective = new /datum/objective
|
||||
new_objective.owner = src
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
// Choose a name, if any.
|
||||
if(flags & ANTAG_CHOOSE_NAME)
|
||||
spawn(5)
|
||||
var/newname = sanitize(copytext(input(player.current, "You are a [role_text]. Would you like to change your name to something else?", "Name change") as null|text,1,MAX_NAME_LEN))
|
||||
var/newname = sanitize(input(player.current, "You are a [role_text]. Would you like to change your name to something else?", "Name change") as null|text, MAX_NAME_LEN)
|
||||
if (newname)
|
||||
player.current.real_name = newname
|
||||
player.current.name = player.current.real_name
|
||||
|
||||
@@ -737,7 +737,7 @@
|
||||
|
||||
if (bufferOption == "changeLabel")
|
||||
var/datum/dna2/record/buf = src.buffers[bufferId]
|
||||
var/text = sanitize(copytext(input(usr, "New Label:", "Edit Label", buf.name) as text|null, 1, MAX_NAME_LEN))
|
||||
var/text = sanitize(input(usr, "New Label:", "Edit Label", buf.name) as text|null, MAX_NAME_LEN)
|
||||
buf.name = text
|
||||
src.buffers[bufferId] = buf
|
||||
return 1
|
||||
|
||||
@@ -657,7 +657,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
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -536,7 +536,7 @@ datum/objective/steal
|
||||
var/tmp_obj = new custom_target
|
||||
var/custom_name = tmp_obj:name
|
||||
del(tmp_obj)
|
||||
custom_name = sanitize(copytext(input("Enter target name:", "Objective target", custom_name) as text|null,1,MAX_MESSAGE_LEN))
|
||||
custom_name = sanitize(input("Enter target name:", "Objective target", custom_name) as text|null)
|
||||
if (!custom_name) return
|
||||
target_name = custom_name
|
||||
steal_target = custom_target
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
spawn(0)
|
||||
var/religion_name = "Christianity"
|
||||
var/new_religion = sanitize(copytext(input(H, "You are the crew services officer. Would you like to change your religion? Default is Christianity, in SPACE.", "Name change", religion_name),1,MAX_NAME_LEN))
|
||||
var/new_religion = sanitize(input(H, "You are the crew services officer. Would you like to change your religion? Default is Christianity, in SPACE.", "Name change", religion_name), MAX_NAME_LEN)
|
||||
|
||||
if (!new_religion)
|
||||
new_religion = religion_name
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
spawn(1)
|
||||
var/deity_name = "Space Jesus"
|
||||
var/new_deity = sanitize(copytext(input(H, "Would you like to change your deity? Default is Space Jesus.", "Name change", deity_name),1,MAX_NAME_LEN))
|
||||
var/new_deity = sanitize(input(H, "Would you like to change your deity? Default is Space Jesus.", "Name change", deity_name), MAX_NAME_LEN)
|
||||
|
||||
if ((length(new_deity) == 0) || (new_deity == "Space Jesus") )
|
||||
new_deity = deity_name
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -583,7 +583,7 @@
|
||||
|
||||
else if(istype(W, /obj/item/weapon/pen))
|
||||
var/t = input(user, "Enter new robot name", src.name, src.created_name) as text
|
||||
t = sanitize(copytext(t, 1, MAX_NAME_LEN))
|
||||
t = sanitize(t, MAX_NAME_LEN)
|
||||
if (!t)
|
||||
return
|
||||
if (!in_range(src, usr) && src.loc != usr)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -307,7 +307,7 @@
|
||||
|
||||
if("setid")
|
||||
refresh=0
|
||||
var/new_id = sanitize(copytext(input("Enter new bot ID", "Mulebot [suffix ? "([suffix])" : ""]", suffix) as text|null,1,MAX_NAME_LEN))
|
||||
var/new_id = sanitize(input("Enter new bot ID", "Mulebot [suffix ? "([suffix])" : ""]", suffix) as text|null, MAX_NAME_LEN)
|
||||
refresh=1
|
||||
if(new_id)
|
||||
suffix = new_id
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
set name = "Store Camera Location"
|
||||
set desc = "Stores your current camera location by the given name"
|
||||
|
||||
loc = sanitize(copytext(loc, 1, MAX_MESSAGE_LEN))
|
||||
loc = sanitize(loc)
|
||||
if(!loc)
|
||||
src << "\red Must supply a location name"
|
||||
return
|
||||
|
||||
@@ -191,7 +191,7 @@
|
||||
if (is_authenticated() && modify)
|
||||
var/t1 = href_list["assign_target"]
|
||||
if(t1 == "Custom")
|
||||
var/temp_t = sanitize(copytext(input("Enter a custom job assignment.","Assignment"),1,45))
|
||||
var/temp_t = sanitize(input("Enter a custom job assignment.","Assignment"), 45)
|
||||
//let custom jobs function as an impromptu alt title, mainly for sechuds
|
||||
if(temp_t && modify)
|
||||
modify.assignment = temp_t
|
||||
@@ -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
|
||||
|
||||
@@ -175,10 +175,10 @@
|
||||
post_status(href_list["statdisp"])
|
||||
|
||||
if("setmsg1")
|
||||
stat_msg1 = reject_bad_text(trim(sanitize(copytext(input("Line 1", "Enter Message Text", stat_msg1) as text|null, 1, 40))), 40)
|
||||
stat_msg1 = reject_bad_text(sanitize(input("Line 1", "Enter Message Text", stat_msg1) as text|null, 40), 40)
|
||||
src.updateDialog()
|
||||
if("setmsg2")
|
||||
stat_msg2 = reject_bad_text(trim(sanitize(copytext(input("Line 2", "Enter Message Text", stat_msg2) as text|null, 1, 40))), 40)
|
||||
stat_msg2 = reject_bad_text(sanitize(input("Line 2", "Enter Message Text", stat_msg2) as text|null, 40), 40)
|
||||
src.updateDialog()
|
||||
|
||||
// OMG CENTCOMM LETTERHEAD
|
||||
@@ -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)
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -250,7 +250,7 @@
|
||||
switch(href_list["field"])
|
||||
if("fingerprint")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please input fingerprint hash:", "Med. records", src.active1.fields["fingerprint"], null) as text,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please input fingerprint hash:", "Med. records", src.active1.fields["fingerprint"], null) as text)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
|
||||
return
|
||||
src.active1.fields["fingerprint"] = t1
|
||||
@@ -268,55 +268,55 @@
|
||||
src.active1.fields["age"] = t1
|
||||
if("mi_dis")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please input minor disabilities list:", "Med. records", src.active2.fields["mi_dis"], null) as text,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please input minor disabilities list:", "Med. records", src.active2.fields["mi_dis"], null) as text)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["mi_dis"] = t1
|
||||
if("mi_dis_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please summarize minor dis.:", "Med. records", src.active2.fields["mi_dis_d"], null) as message,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please summarize minor dis.:", "Med. records", src.active2.fields["mi_dis_d"], null) as message)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["mi_dis_d"] = t1
|
||||
if("ma_dis")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please input major diabilities list:", "Med. records", src.active2.fields["ma_dis"], null) as text,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please input major diabilities list:", "Med. records", src.active2.fields["ma_dis"], null) as text)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["ma_dis"] = t1
|
||||
if("ma_dis_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please summarize major dis.:", "Med. records", src.active2.fields["ma_dis_d"], null) as message,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please summarize major dis.:", "Med. records", src.active2.fields["ma_dis_d"], null) as message)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["ma_dis_d"] = t1
|
||||
if("alg")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please state allergies:", "Med. records", src.active2.fields["alg"], null) as text,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please state allergies:", "Med. records", src.active2.fields["alg"], null) as text)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["alg"] = t1
|
||||
if("alg_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please summarize allergies:", "Med. records", src.active2.fields["alg_d"], null) as message,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please summarize allergies:", "Med. records", src.active2.fields["alg_d"], null) as message)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["alg_d"] = t1
|
||||
if("cdi")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please state diseases:", "Med. records", src.active2.fields["cdi"], null) as text,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please state diseases:", "Med. records", src.active2.fields["cdi"], null) as text)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["cdi"] = t1
|
||||
if("cdi_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please summarize diseases:", "Med. records", src.active2.fields["cdi_d"], null) as message,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please summarize diseases:", "Med. records", src.active2.fields["cdi_d"], null) as message)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["cdi_d"] = t1
|
||||
if("notes")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = html_encode(trim(copytext(input("Please summarize notes:", "Med. records", html_decode(src.active2.fields["notes"]), null) as message,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please summarize notes:", "Med. records", html_decode(src.active2.fields["notes"]), null) as message, extra = 0)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["notes"] = t1
|
||||
@@ -331,21 +331,21 @@
|
||||
src.temp = text("<B>Blood Type:</B><BR>\n\t<A href='?src=\ref[];temp=1;b_type=an'>A-</A> <A href='?src=\ref[];temp=1;b_type=ap'>A+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=bn'>B-</A> <A href='?src=\ref[];temp=1;b_type=bp'>B+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=abn'>AB-</A> <A href='?src=\ref[];temp=1;b_type=abp'>AB+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=on'>O-</A> <A href='?src=\ref[];temp=1;b_type=op'>O+</A><BR>", src, src, src, src, src, src, src, src)
|
||||
if("b_dna")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please input DNA hash:", "Med. records", src.active2.fields["b_dna"], null) as text,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please input DNA hash:", "Med. records", src.active2.fields["b_dna"], null) as text)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["b_dna"] = t1
|
||||
if("vir_name")
|
||||
var/datum/data/record/v = locate(href_list["edit_vir"])
|
||||
if (v)
|
||||
var/t1 = trim(sanitize(copytext(input("Please input pathogen name:", "VirusDB", v.fields["name"], null) as text,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please input pathogen name:", "VirusDB", v.fields["name"], null) as text)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
|
||||
return
|
||||
v.fields["name"] = t1
|
||||
if("vir_desc")
|
||||
var/datum/data/record/v = locate(href_list["edit_vir"])
|
||||
if (v)
|
||||
var/t1 = trim(sanitize(copytext(input("Please input information about pathogen:", "VirusDB", v.fields["description"], null) as message,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please input information about pathogen:", "VirusDB", v.fields["description"], null) as message)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
|
||||
return
|
||||
v.fields["description"] = t1
|
||||
@@ -450,7 +450,7 @@
|
||||
if (!( istype(src.active2, /datum/data/record) ))
|
||||
return
|
||||
var/a2 = src.active2
|
||||
var/t1 = trim(sanitize(copytext(input("Add Comment:", "Med. records", null, null) as message,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Add Comment:", "Med. records", null, null) as message)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
var/counter = 1
|
||||
|
||||
@@ -409,7 +409,7 @@
|
||||
|
||||
//Select Your Name
|
||||
if("Sender")
|
||||
customsender = input(usr, "Please enter the sender's name.") as text|null
|
||||
customsender = sanitize(input(usr, "Please enter the sender's name.") as text|null)
|
||||
|
||||
//Select Receiver
|
||||
if("Recepient")
|
||||
@@ -425,12 +425,12 @@
|
||||
|
||||
//Enter custom job
|
||||
if("RecJob")
|
||||
customjob = input(usr, "Please enter the sender's job.") as text|null
|
||||
customjob = sanitize(input(usr, "Please enter the sender's job.") as text|null)
|
||||
|
||||
//Enter message
|
||||
if("Message")
|
||||
custommessage = input(usr, "Please enter your message.") as text|null
|
||||
custommessage = sanitize(copytext(custommessage, 1, MAX_MESSAGE_LEN))
|
||||
custommessage = sanitize(custommessage)
|
||||
|
||||
//Send message
|
||||
if("Send")
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
usr << "Unauthorized Access."
|
||||
|
||||
else if(href_list["warn"])
|
||||
var/warning = sanitize(copytext(input(usr,"Message:","Enter your message here!",""),1,MAX_MESSAGE_LEN))
|
||||
var/warning = sanitize(input(usr,"Message:","Enter your message here!",""))
|
||||
if(!warning) return
|
||||
var/obj/item/weapon/implant/I = locate(href_list["warn"])
|
||||
if((I)&&(I.imp_in))
|
||||
|
||||
@@ -384,7 +384,7 @@ What a mess.*/
|
||||
if (!( istype(active2, /datum/data/record) ))
|
||||
return
|
||||
var/a2 = active2
|
||||
var/t1 = trim(sanitize(copytext(input("Add Comment:", "Secure. records", null, null) as message,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Add Comment:", "Secure. records", null, null) as message)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
|
||||
return
|
||||
var/counter = 1
|
||||
@@ -426,19 +426,19 @@ 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
|
||||
if("id")
|
||||
if (istype(active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please input id:", "Secure. records", active1.fields["id"], null) as text,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please input id:", "Secure. records", active1.fields["id"], null) as text)
|
||||
if (!t1 || active1 != a1)
|
||||
return
|
||||
active1.fields["id"] = t1
|
||||
if("fingerprint")
|
||||
if (istype(active1, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please input fingerprint hash:", "Secure. records", active1.fields["fingerprint"], null) as text,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please input fingerprint hash:", "Secure. records", active1.fields["fingerprint"], null) as text)
|
||||
if (!t1 || active1 != a1)
|
||||
return
|
||||
active1.fields["fingerprint"] = t1
|
||||
@@ -456,31 +456,31 @@ What a mess.*/
|
||||
active1.fields["age"] = t1
|
||||
if("mi_crim")
|
||||
if (istype(active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please input minor disabilities list:", "Secure. records", active2.fields["mi_crim"], null) as text,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please input minor disabilities list:", "Secure. records", active2.fields["mi_crim"], null) as text)
|
||||
if (!t1 || active2 != a2)
|
||||
return
|
||||
active2.fields["mi_crim"] = t1
|
||||
if("mi_crim_d")
|
||||
if (istype(active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please summarize minor dis.:", "Secure. records", active2.fields["mi_crim_d"], null) as message,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please summarize minor dis.:", "Secure. records", active2.fields["mi_crim_d"], null) as message)
|
||||
if (!t1 || active2 != a2)
|
||||
return
|
||||
active2.fields["mi_crim_d"] = t1
|
||||
if("ma_crim")
|
||||
if (istype(active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please input major diabilities list:", "Secure. records", active2.fields["ma_crim"], null) as text,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please input major diabilities list:", "Secure. records", active2.fields["ma_crim"], null) as text)
|
||||
if (!t1 || active2 != a2)
|
||||
return
|
||||
active2.fields["ma_crim"] = t1
|
||||
if("ma_crim_d")
|
||||
if (istype(active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please summarize major dis.:", "Secure. records", active2.fields["ma_crim_d"], null) as message,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please summarize major dis.:", "Secure. records", active2.fields["ma_crim_d"], null) as message)
|
||||
if (!t1 || active2 != a2)
|
||||
return
|
||||
active2.fields["ma_crim_d"] = t1
|
||||
if("notes")
|
||||
if (istype(active2, /datum/data/record))
|
||||
var/t1 = html_encode(trim(copytext(input("Please summarize notes:", "Secure. records", html_decode(active2.fields["notes"]), null) as message,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please summarize notes:", "Secure. records", html_decode(active2.fields["notes"]), null) as message, extra = 0)
|
||||
if (!t1 || active2 != a2)
|
||||
return
|
||||
active2.fields["notes"] = t1
|
||||
@@ -507,7 +507,7 @@ What a mess.*/
|
||||
alert(usr, "You do not have the required rank to do this!")
|
||||
if("species")
|
||||
if (istype(active1, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please enter race:", "General records", active1.fields["species"], null) as message,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please enter race:", "General records", active1.fields["species"], null) as message)
|
||||
if (!t1 || active1 != a1)
|
||||
return
|
||||
active1.fields["species"] = t1
|
||||
|
||||
@@ -309,19 +309,19 @@ 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
|
||||
if("id")
|
||||
if (istype(active1, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please input id:", "Secure. records", active1.fields["id"], null) as text,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please input id:", "Secure. records", active1.fields["id"], null) as text)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
|
||||
return
|
||||
active1.fields["id"] = t1
|
||||
if("fingerprint")
|
||||
if (istype(active1, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please input fingerprint hash:", "Secure. records", active1.fields["fingerprint"], null) as text,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please input fingerprint hash:", "Secure. records", active1.fields["fingerprint"], null) as text)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
|
||||
return
|
||||
active1.fields["fingerprint"] = t1
|
||||
@@ -350,7 +350,7 @@ What a mess.*/
|
||||
alert(usr, "You do not have the required rank to do this!")
|
||||
if("species")
|
||||
if (istype(active1, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please enter race:", "General records", active1.fields["species"], null) as message,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please enter race:", "General records", active1.fields["species"], null) as message)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
|
||||
return
|
||||
active1.fields["species"] = t1
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
if(!istype(P)) return
|
||||
|
||||
var/timeout = world.time + 600
|
||||
var/reason = sanitize(copytext(input(usr,"Reason:","Why do you require this item?","") as null|text,1,MAX_MESSAGE_LEN))
|
||||
var/reason = sanitize(input(usr,"Reason:","Why do you require this item?","") as null|text)
|
||||
if(world.time > timeout) return
|
||||
if(!reason) return
|
||||
|
||||
@@ -289,7 +289,7 @@
|
||||
if(!istype(P)) return
|
||||
|
||||
var/timeout = world.time + 600
|
||||
var/reason = sanitize(copytext(input(usr,"Reason:","Why do you require this item?","") as null|text,1,MAX_MESSAGE_LEN))
|
||||
var/reason = sanitize(input(usr,"Reason:","Why do you require this item?","") as null|text)
|
||||
if(world.time > timeout) return
|
||||
if(!reason) return
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@
|
||||
if(auth)
|
||||
var/t1 = href_list["assign"]
|
||||
if(t1 == "Custom")
|
||||
var/temp_t = sanitize(copytext(input("Enter a custom job assignment.","Assignment"),1,MAX_MESSAGE_LEN))
|
||||
var/temp_t = sanitize(input("Enter a custom job assignment.","Assignment"))
|
||||
if(temp_t)
|
||||
t1 = temp_t
|
||||
set_default_access(t1)
|
||||
|
||||
@@ -178,10 +178,10 @@
|
||||
post_status(href_list["statdisp"])
|
||||
|
||||
if("setmsg1" in href_list)
|
||||
stat_msg1 = reject_bad_text(trim(sanitize(copytext(input("Line 1", "Enter Message Text", stat_msg1) as text|null, 1, 40)), 40))
|
||||
stat_msg1 = reject_bad_text(sanitize(input("Line 1", "Enter Message Text", stat_msg1) as text|null, 40), 40)
|
||||
computer.updateDialog()
|
||||
if("setmsg2" in href_list)
|
||||
stat_msg2 = reject_bad_text(trim(sanitize(copytext(input("Line 2", "Enter Message Text", stat_msg2) as text|null, 1, 40)), 40))
|
||||
stat_msg2 = reject_bad_text(sanitize(input("Line 2", "Enter Message Text", stat_msg2) as text|null, 40), 40)
|
||||
computer.updateDialog()
|
||||
|
||||
// OMG CENTCOMM LETTERHEAD
|
||||
@@ -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)
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
var/icon/side = active1.fields["photo_side"]
|
||||
usr << browse_rsc(front, "front.png")
|
||||
usr << browse_rsc(side, "side.png")
|
||||
|
||||
|
||||
dat += "<table><tr><td>Name: [active1.fields["name"]] \
|
||||
ID: [active1.fields["id"]]<BR>\n \
|
||||
Sex: <A href='?src=\ref[src];field=sex'>[active1.fields["sex"]]</A><BR>\n \
|
||||
@@ -264,7 +264,7 @@
|
||||
switch(href_list["field"])
|
||||
if("fingerprint")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please input fingerprint hash:", "Med. records", src.active1.fields["fingerprint"], null) as text,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please input fingerprint hash:", "Med. records", src.active1.fields["fingerprint"], null) as text)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
|
||||
return
|
||||
src.active1.fields["fingerprint"] = t1
|
||||
@@ -282,55 +282,55 @@
|
||||
src.active1.fields["age"] = t1
|
||||
if("mi_dis")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please input minor disabilities list:", "Med. records", src.active2.fields["mi_dis"], null) as text,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please input minor disabilities list:", "Med. records", src.active2.fields["mi_dis"], null) as text)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["mi_dis"] = t1
|
||||
if("mi_dis_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please summarize minor dis.:", "Med. records", src.active2.fields["mi_dis_d"], null) as message,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please summarize minor dis.:", "Med. records", src.active2.fields["mi_dis_d"], null) as message)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["mi_dis_d"] = t1
|
||||
if("ma_dis")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please input major diabilities list:", "Med. records", src.active2.fields["ma_dis"], null) as text,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please input major diabilities list:", "Med. records", src.active2.fields["ma_dis"], null) as text)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["ma_dis"] = t1
|
||||
if("ma_dis_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please summarize major dis.:", "Med. records", src.active2.fields["ma_dis_d"], null) as message,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please summarize major dis.:", "Med. records", src.active2.fields["ma_dis_d"], null) as message)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["ma_dis_d"] = t1
|
||||
if("alg")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please state allergies:", "Med. records", src.active2.fields["alg"], null) as text,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please state allergies:", "Med. records", src.active2.fields["alg"], null) as text)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["alg"] = t1
|
||||
if("alg_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please summarize allergies:", "Med. records", src.active2.fields["alg_d"], null) as message,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please summarize allergies:", "Med. records", src.active2.fields["alg_d"], null) as message)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["alg_d"] = t1
|
||||
if("cdi")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please state diseases:", "Med. records", src.active2.fields["cdi"], null) as text,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please state diseases:", "Med. records", src.active2.fields["cdi"], null) as text)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["cdi"] = t1
|
||||
if("cdi_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please summarize diseases:", "Med. records", src.active2.fields["cdi_d"], null) as message,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please summarize diseases:", "Med. records", src.active2.fields["cdi_d"], null) as message)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["cdi_d"] = t1
|
||||
if("notes")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = html_encode(trim(copytext(input("Please summarize notes:", "Med. records", html_decode(src.active2.fields["notes"]), null) as message,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please summarize notes:", "Med. records", html_decode(src.active2.fields["notes"]), null) as message, extra = 0)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["notes"] = t1
|
||||
@@ -345,21 +345,21 @@
|
||||
src.temp = text("<B>Blood Type:</B><BR>\n\t<A href='?src=\ref[];temp=1;b_type=an'>A-</A> <A href='?src=\ref[];temp=1;b_type=ap'>A+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=bn'>B-</A> <A href='?src=\ref[];temp=1;b_type=bp'>B+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=abn'>AB-</A> <A href='?src=\ref[];temp=1;b_type=abp'>AB+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=on'>O-</A> <A href='?src=\ref[];temp=1;b_type=op'>O+</A><BR>", src, src, src, src, src, src, src, src)
|
||||
if("b_dna")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = sanitize(copytext(trim(input("Please input DNA hash:", "Med. records", src.active2.fields["b_dna"], null) as text),1,MAX_MESSAGE_LEN))
|
||||
var/t1 = sanitize(input("Please input DNA hash:", "Med. records", src.active2.fields["b_dna"], null) as text)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["b_dna"] = t1
|
||||
if("vir_name")
|
||||
var/datum/data/record/v = locate(href_list["edit_vir"])
|
||||
if (v)
|
||||
var/t1 = trim(sanitize(copytext(input("Please input pathogen name:", "VirusDB", v.fields["name"], null) as text,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please input pathogen name:", "VirusDB", v.fields["name"], null) as text)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
|
||||
return
|
||||
v.fields["name"] = t1
|
||||
if("vir_desc")
|
||||
var/datum/data/record/v = locate(href_list["edit_vir"])
|
||||
if (v)
|
||||
var/t1 = trim(sanitize(copytext(input("Please input information about pathogen:", "VirusDB", v.fields["description"], null) as message,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please input information about pathogen:", "VirusDB", v.fields["description"], null) as message)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
|
||||
return
|
||||
v.fields["description"] = t1
|
||||
@@ -464,7 +464,7 @@
|
||||
if (!( istype(src.active2, /datum/data/record) ))
|
||||
return
|
||||
var/a2 = src.active2
|
||||
var/t1 = sanitize(copytext(input("Add Comment:", "Med. records", null, null) as message,1,MAX_MESSAGE_LEN))
|
||||
var/t1 = sanitize(input("Add Comment:", "Med. records", null, null) as message)
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
|
||||
return
|
||||
var/counter = 1
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
screen = !screen
|
||||
|
||||
else if(href_list["warn"])
|
||||
var/warning = trim(sanitize(copytext(input(usr,"Message:","Enter your message here!",""),1,MAX_MESSAGE_LEN)))
|
||||
var/warning = sanitize(input(usr,"Message:","Enter your message here!",""))
|
||||
if(!warning) return
|
||||
var/obj/item/weapon/implant/I = locate(href_list["warn"])
|
||||
if( istype(I) && I.imp_in)
|
||||
|
||||
@@ -404,7 +404,7 @@ What a mess.*/
|
||||
if (!( istype(active2, /datum/data/record) ))
|
||||
return
|
||||
var/a2 = active2
|
||||
var/t1 = sanitize(copytext(input("Add Comment:", "Secure. records", null, null) as message,1,MAX_MESSAGE_LEN))
|
||||
var/t1 = sanitize(input("Add Comment:", "Secure. records", null, null) as message)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active2 != a2))
|
||||
return
|
||||
var/counter = 1
|
||||
@@ -444,19 +444,19 @@ 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
|
||||
if("id")
|
||||
if (istype(active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please input id:", "Secure. records", active1.fields["id"], null) as text,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please input id:", "Secure. records", active1.fields["id"], null) as text)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active1 != a1))
|
||||
return
|
||||
active1.fields["id"] = t1
|
||||
if("fingerprint")
|
||||
if (istype(active1, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please input fingerprint hash:", "Secure. records", active1.fields["fingerprint"], null) as text,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please input fingerprint hash:", "Secure. records", active1.fields["fingerprint"], null) as text)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active1 != a1))
|
||||
return
|
||||
active1.fields["fingerprint"] = t1
|
||||
@@ -474,31 +474,31 @@ What a mess.*/
|
||||
active1.fields["age"] = t1
|
||||
if("mi_crim")
|
||||
if (istype(active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please input minor disabilities list:", "Secure. records", active2.fields["mi_crim"], null) as text,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please input minor disabilities list:", "Secure. records", active2.fields["mi_crim"], null) as text)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active2 != a2))
|
||||
return
|
||||
active2.fields["mi_crim"] = t1
|
||||
if("mi_crim_d")
|
||||
if (istype(active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please summarize minor dis.:", "Secure. records", active2.fields["mi_crim_d"], null) as message,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please summarize minor dis.:", "Secure. records", active2.fields["mi_crim_d"], null) as message)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active2 != a2))
|
||||
return
|
||||
active2.fields["mi_crim_d"] = t1
|
||||
if("ma_crim")
|
||||
if (istype(active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please input major diabilities list:", "Secure. records", active2.fields["ma_crim"], null) as text,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please input major diabilities list:", "Secure. records", active2.fields["ma_crim"], null) as text)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active2 != a2))
|
||||
return
|
||||
active2.fields["ma_crim"] = t1
|
||||
if("ma_crim_d")
|
||||
if (istype(active2, /datum/data/record))
|
||||
var/t1 = trim(sanitize(copytext(input("Please summarize major dis.:", "Secure. records", active2.fields["ma_crim_d"], null) as message,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please summarize major dis.:", "Secure. records", active2.fields["ma_crim_d"], null) as message)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active2 != a2))
|
||||
return
|
||||
active2.fields["ma_crim_d"] = t1
|
||||
if("notes")
|
||||
if (istype(active2, /datum/data/record))
|
||||
var/t1 = html_encode(trim(copytext(input("Please summarize notes:", "Secure. records", html_decode(active2.fields["notes"]), null) as message,1,MAX_MESSAGE_LEN)))
|
||||
var/t1 = sanitize(input("Please summarize notes:", "Secure. records", html_decode(active2.fields["notes"]), null) as message, extra = 0)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active2 != a2))
|
||||
return
|
||||
active2.fields["notes"] = t1
|
||||
@@ -525,7 +525,7 @@ What a mess.*/
|
||||
alert(usr, "You do not have the required rank to do this!")
|
||||
if("species")
|
||||
if (istype(active1, /datum/data/record))
|
||||
var/t1 = sanitize(copytext(input("Please enter race:", "General records", active1.fields["species"], null) as message,1,MAX_MESSAGE_LEN))
|
||||
var/t1 = sanitize(input("Please enter race:", "General records", active1.fields["species"], null) as message)
|
||||
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active1 != a1))
|
||||
return
|
||||
active1.fields["species"] = t1
|
||||
|
||||
@@ -323,7 +323,7 @@
|
||||
if(speed <= 0)
|
||||
speed = 1
|
||||
if("setpath")
|
||||
var/newpath = sanitize(copytext(input(usr, "Please define a new path!",,path) as text|null,1,MAX_MESSAGE_LEN))
|
||||
var/newpath = sanitize(input(usr, "Please define a new path!",,path) as text|null)
|
||||
if(newpath && newpath != "")
|
||||
moving = 0 // stop moving
|
||||
path = newpath
|
||||
|
||||
@@ -194,7 +194,7 @@ Transponder Codes:<UL>"}
|
||||
updateDialog()
|
||||
|
||||
else if(href_list["locedit"])
|
||||
var/newloc = sanitize(copytext(input("Enter New Location", "Navigation Beacon", location) as text|null,1,MAX_MESSAGE_LEN))
|
||||
var/newloc = sanitize(input("Enter New Location", "Navigation Beacon", location) as text|null)
|
||||
if(newloc)
|
||||
location = newloc
|
||||
updateDialog()
|
||||
|
||||
@@ -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,8 +936,8 @@ 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", "") )
|
||||
s = sanitize(copytext(s, 1, MAX_MESSAGE_LEN))
|
||||
var/s = sanitize(input(user, "Write something", "Newspaper", ""))
|
||||
s = sanitize(s)
|
||||
if (!s)
|
||||
return
|
||||
if (!in_range(src, usr) && src.loc != usr)
|
||||
|
||||
@@ -818,7 +818,7 @@
|
||||
|
||||
if(istype(I, /obj/item/weapon/pen)) //you can rename turrets like bots!
|
||||
var/t = input(user, "Enter new turret name", name, finish_name) as text
|
||||
t = sanitize(copytext(t, 1, MAX_MESSAGE_LEN))
|
||||
t = sanitize(t)
|
||||
if(!t)
|
||||
return
|
||||
if(!in_range(src, usr) && loc != usr)
|
||||
|
||||
@@ -223,7 +223,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
|
||||
if(reject_bad_text(href_list["write"]))
|
||||
dpt = ckey(href_list["write"]) //write contains the string of the receiving department's name
|
||||
|
||||
var/new_message = copytext(reject_bad_text(input(usr, "Write your message:", "Awaiting Input", "")),1,MAX_MESSAGE_LEN)
|
||||
var/new_message = sanitize(input("Write your message:", "Awaiting Input", ""))
|
||||
if(new_message)
|
||||
message = new_message
|
||||
screen = 9
|
||||
@@ -238,7 +238,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
|
||||
priority = -1
|
||||
|
||||
if(href_list["writeAnnouncement"])
|
||||
var/new_message = copytext(reject_bad_text(input(usr, "Write your message:", "Awaiting Input", "")),1,MAX_MESSAGE_LEN)
|
||||
var/new_message = sanitize(input("Write your message:", "Awaiting Input", ""))
|
||||
if(new_message)
|
||||
message = new_message
|
||||
switch(href_list["priority"])
|
||||
|
||||
@@ -284,7 +284,7 @@
|
||||
src.log_message("Interfaced with [src_object].")
|
||||
return STATUS_INTERACTIVE
|
||||
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)
|
||||
return
|
||||
@@ -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")
|
||||
|
||||
@@ -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"])
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
return
|
||||
if (!in_range(src, user) && src.loc != user)
|
||||
return
|
||||
t = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
|
||||
t = sanitize(t)
|
||||
if (t)
|
||||
src.name = "body bag - "
|
||||
src.name += t
|
||||
|
||||
@@ -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
|
||||
@@ -726,7 +726,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
U << "The PDA softly beeps."
|
||||
ui.close()
|
||||
else
|
||||
t = sanitize(copytext(t, 1, 20))
|
||||
t = sanitize(t, 20)
|
||||
ttone = t
|
||||
else
|
||||
ui.close()
|
||||
@@ -735,7 +735,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
var/t = input(U, "Please enter new news tone", name, newstone) as text
|
||||
if (in_range(src, U) && loc == U)
|
||||
if (t)
|
||||
t = sanitize(copytext(t, 1, 20))
|
||||
t = sanitize(t, 20)
|
||||
newstone = t
|
||||
else
|
||||
ui.close()
|
||||
@@ -971,8 +971,9 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
U.visible_message("<span class='notice'>[U] taps on \his PDA's screen.</span>")
|
||||
U.last_target_click = world.time
|
||||
var/t = input(U, "Please enter message", P.name, null) as text
|
||||
t = sanitize(copytext(t, 1, MAX_MESSAGE_LEN))
|
||||
t = readd_quotes(t)
|
||||
t = sanitize(t)
|
||||
//t = readd_quotes(t)
|
||||
t = replace_characters(t, list(""" = "\""))
|
||||
if (!t || !istype(P))
|
||||
return
|
||||
if (!in_range(src, U) && loc != U)
|
||||
|
||||
@@ -562,10 +562,10 @@
|
||||
if("alert")
|
||||
post_status("alert", href_list["alert"])
|
||||
if("setmsg1")
|
||||
message1 = reject_bad_text(trim(sanitize(copytext(input("Line 1", "Enter Message Text", message1) as text|null, 1, 40))), 40)
|
||||
message1 = reject_bad_text(sanitize(input("Line 1", "Enter Message Text", message1) as text|null, 40), 40)
|
||||
updateSelfDialog()
|
||||
if("setmsg2")
|
||||
message2 = reject_bad_text(trim(sanitize(copytext(input("Line 2", "Enter Message Text", message2) as text|null, 1, 40))), 40)
|
||||
message2 = reject_bad_text(sanitize(input("Line 2", "Enter Message Text", message2) as text|null, 40), 40)
|
||||
updateSelfDialog()
|
||||
else
|
||||
post_status(href_list["statdisp"])
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
user << "\red \The [src] needs to recharge!"
|
||||
return
|
||||
|
||||
var/message = sanitize(copytext(input(user, "Shout a message?", "Megaphone", null) as text,1,MAX_MESSAGE_LEN))
|
||||
var/message = sanitize(input(user, "Shout a message?", "Megaphone", null) as text)
|
||||
if(!message)
|
||||
return
|
||||
message = capitalize(message)
|
||||
|
||||
@@ -260,7 +260,7 @@
|
||||
if(2)
|
||||
radio.ToggleReception()
|
||||
if(href_list["setlaws"])
|
||||
var/newlaws = sanitize(copytext(input("Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.pai_laws) as message,1,MAX_MESSAGE_LEN))
|
||||
var/newlaws = sanitize(input("Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.pai_laws) as message)
|
||||
if(newlaws)
|
||||
pai.pai_laws = newlaws
|
||||
pai << "Your supplemental directives have been updated. Your new directives are:"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -265,7 +265,7 @@ AI MODULES
|
||||
if(new_lawpos < MIN_SUPPLIED_LAW_NUMBER) return
|
||||
lawpos = min(new_lawpos, MAX_SUPPLIED_LAW_NUMBER)
|
||||
var/newlaw = ""
|
||||
var/targName = sanitize(copytext(input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw),1,MAX_MESSAGE_LEN))
|
||||
var/targName = sanitize(input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw))
|
||||
newFreeFormLaw = targName
|
||||
desc = "A 'freeform' AI module: ([lawpos]) '[newFreeFormLaw]'"
|
||||
|
||||
@@ -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]'"
|
||||
|
||||
|
||||
@@ -224,13 +224,13 @@
|
||||
/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
|
||||
src.registered_name = t
|
||||
|
||||
var u = sanitize(copytext(input(user, "What occupation would you like to put on this card?\nNote: This will not grant any access levels other than Maintenance.", "Agent card job assignment", "Agent"),1,MAX_MESSAGE_LEN))
|
||||
var u = sanitize(input(user, "What occupation would you like to put on this card?\nNote: This will not grant any access levels other than Maintenance.", "Agent card job assignment", "Agent"))
|
||||
if(!u)
|
||||
alert("Invalid assignment.")
|
||||
src.registered_name = ""
|
||||
@@ -245,13 +245,13 @@
|
||||
|
||||
switch(alert("Would you like to display the ID, or retitle it?","Choose.","Rename","Show"))
|
||||
if("Rename")
|
||||
var t = sanitize(copytext(input(user, "What name would you like to put on this card?", "Agent card name", ishuman(user) ? user.real_name : user.name),1,26))
|
||||
var t = sanitize(input(user, "What name would you like to put on this card?", "Agent card name", ishuman(user) ? user.real_name : user.name), 26)
|
||||
if(!t || t == "Unknown" || t == "floor" || t == "wall" || t == "r-wall") //Same as mob/new_player/prefrences.dm
|
||||
alert("Invalid name.")
|
||||
return
|
||||
src.registered_name = t
|
||||
|
||||
var u = sanitize(copytext(input(user, "What occupation would you like to put on this card?\nNote: This will not grant any access levels other than Maintenance.", "Agent card job assignment", "Assistant"),1,MAX_MESSAGE_LEN))
|
||||
var u = sanitize(input(user, "What occupation would you like to put on this card?\nNote: This will not grant any access levels other than Maintenance.", "Agent card job assignment", "Assistant"))
|
||||
if(!u)
|
||||
alert("Invalid assignment.")
|
||||
return
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
return
|
||||
if((!in_range(src, usr) && src.loc != user))
|
||||
return
|
||||
t = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
|
||||
t = sanitize(t)
|
||||
if(t)
|
||||
src.name = text("Glass Case - '[]'", t)
|
||||
else
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
return
|
||||
if ((!in_range(src, usr) && src.loc != user))
|
||||
return
|
||||
t = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
|
||||
t = sanitize(t)
|
||||
if (t)
|
||||
src.name = text("Morgue- '[]'", t)
|
||||
else
|
||||
@@ -258,7 +258,7 @@
|
||||
return
|
||||
if ((!in_range(src, usr) > 1 && src.loc != user))
|
||||
return
|
||||
t = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
|
||||
t = sanitize(t)
|
||||
if (t)
|
||||
src.name = text("Crematorium- '[]'", t)
|
||||
else
|
||||
|
||||
@@ -53,7 +53,7 @@ client/verb/JoinResponseTeam()
|
||||
|
||||
for (var/obj/effect/landmark/L in landmarks_list) if (L.name == "Commando")
|
||||
L.name = null//Reserving the place.
|
||||
var/new_name = input(usr, "Pick a name","Name") as null|text
|
||||
var/new_name = sanitizeSafe(input(usr, "Pick a name","Name") as null|text, MAX_NAME_LEN)
|
||||
if(!new_name)//Somebody changed his mind, place is available again.
|
||||
L.name = "Commando"
|
||||
return
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
src << "Guests may not use OOC."
|
||||
return
|
||||
|
||||
msg = trim(sanitize(copytext(msg, 1, MAX_MESSAGE_LEN)))
|
||||
msg = sanitize(msg)
|
||||
if(!msg) return
|
||||
|
||||
if(!(prefs.toggles & CHAT_OOC))
|
||||
@@ -77,7 +77,7 @@
|
||||
src << "Guests may not use OOC."
|
||||
return
|
||||
|
||||
msg = trim(sanitize(copytext(msg, 1, MAX_MESSAGE_LEN)))
|
||||
msg = sanitize(msg)
|
||||
if(!msg) return
|
||||
|
||||
if(!(prefs.toggles & CHAT_LOOC))
|
||||
|
||||
@@ -181,7 +181,7 @@ datum/admins/proc/DB_ban_edit(var/banid = null, var/param = null)
|
||||
switch(param)
|
||||
if("reason")
|
||||
if(!value)
|
||||
value = input("Insert the new reason for [pckey]'s ban", "New Reason", "[reason]", null) as null|text
|
||||
value = sanitize(input("Insert the new reason for [pckey]'s ban", "New Reason", "[reason]", null) as null|text)
|
||||
value = sql_sanitize_text(value)
|
||||
if(!value)
|
||||
usr << "Cancelled"
|
||||
|
||||
@@ -725,10 +725,10 @@ var/global/floorIsLava = 0
|
||||
set desc="Announce your desires to the world"
|
||||
if(!check_rights(0)) return
|
||||
|
||||
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//todo: sanitize for all?
|
||||
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!
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
/client/proc/admin_memo_write()
|
||||
var/savefile/F = new(MEMOFILE)
|
||||
if(F)
|
||||
var/memo = input(src,"Type your memo\n(Leaving it blank will delete your current memo):","Write Memo",null) as null|message
|
||||
var/memo = sanitize(input(src,"Type your memo\n(Leaving it blank will delete your current memo):","Write Memo",null) as null|message, extra = 0)
|
||||
switch(memo)
|
||||
if(null)
|
||||
return
|
||||
|
||||
@@ -617,7 +617,7 @@ var/list/admin_verbs_mentor = list(
|
||||
set name = "Make Sound"
|
||||
set desc = "Display a message to everyone who can hear the target"
|
||||
if(O)
|
||||
var/message = input("What do you want the message to be?", "Make Sound") as text|null
|
||||
var/message = sanitize(input("What do you want the message to be?", "Make Sound") as text|null)
|
||||
if(!message)
|
||||
return
|
||||
for (var/mob/V in hearers(O))
|
||||
@@ -709,7 +709,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)
|
||||
|
||||
+17
-24
@@ -328,12 +328,12 @@
|
||||
mins = min(525599,mins)
|
||||
minutes = CMinutes + mins
|
||||
duration = GetExp(minutes)
|
||||
reason = input(usr,"Reason?","reason",reason2) as text|null
|
||||
reason = sanitize(input(usr,"Reason?","reason",reason2) as text|null)
|
||||
if(!reason) return
|
||||
if("No")
|
||||
temp = 0
|
||||
duration = "Perma"
|
||||
reason = input(usr,"Reason?","reason",reason2) as text|null
|
||||
reason = sanitize(input(usr,"Reason?","reason",reason2) as text|null)
|
||||
if(!reason) return
|
||||
|
||||
log_admin("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]")
|
||||
@@ -655,7 +655,7 @@
|
||||
var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null
|
||||
if(!mins)
|
||||
return
|
||||
var/reason = input(usr,"Reason?","Please State Reason","") as text|null
|
||||
var/reason = sanitize(input(usr,"Reason?","Please State Reason","") as text|null)
|
||||
if(!reason)
|
||||
return
|
||||
|
||||
@@ -680,7 +680,7 @@
|
||||
return 1
|
||||
if("No")
|
||||
if(!check_rights(R_BAN)) return
|
||||
var/reason = input(usr,"Reason?","Please State Reason","") as text|null
|
||||
var/reason = sanitize(input(usr,"Reason?","Please State Reason","") as text|null)
|
||||
if(reason)
|
||||
var/msg
|
||||
for(var/job in notbannedlist)
|
||||
@@ -737,7 +737,7 @@
|
||||
if (ismob(M))
|
||||
if(!check_if_greater_rights_than(M.client))
|
||||
return
|
||||
var/reason = input("Please enter reason")
|
||||
var/reason = sanitize(input("Please enter reason"))
|
||||
if(!reason)
|
||||
M << "\red You have been kicked from the server"
|
||||
else
|
||||
@@ -794,7 +794,7 @@
|
||||
if(!mins)
|
||||
return
|
||||
if(mins >= 525600) mins = 525599
|
||||
var/reason = input(usr,"Reason?","reason","Griefer") as text|null
|
||||
var/reason = sanitize(input(usr,"Reason?","reason","Griefer") as text|null)
|
||||
if(!reason)
|
||||
return
|
||||
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 1, mins)
|
||||
@@ -815,7 +815,7 @@
|
||||
//del(M) // See no reason why to delete mob. Important stuff can be lost. And ban can be lifted before round ends.
|
||||
if("No")
|
||||
if(!check_rights(R_BAN)) return
|
||||
var/reason = input(usr,"Reason?","reason","Griefer") as text|null
|
||||
var/reason = sanitize(input(usr,"Reason?","reason","Griefer") as text|null)
|
||||
if(!reason)
|
||||
return
|
||||
switch(alert(usr,"IP ban?",,"Yes","No","Cancel"))
|
||||
@@ -1341,7 +1341,7 @@
|
||||
usr << "The person you are trying to contact is not wearing a headset"
|
||||
return
|
||||
|
||||
var/input = input(src.owner, "Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from Centcomm", "")
|
||||
var/input = sanitize(input(src.owner, "Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from Centcomm", ""))
|
||||
if(!input) return
|
||||
|
||||
src.owner << "You sent [input] to [H] via a secure channel."
|
||||
@@ -1358,7 +1358,7 @@
|
||||
usr << "The person you are trying to contact is not wearing a headset"
|
||||
return
|
||||
|
||||
var/input = input(src.owner, "Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from a shadowy figure...", "")
|
||||
var/input = sanitize(input(src.owner, "Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from a shadowy figure...", ""))
|
||||
if(!input) return
|
||||
|
||||
src.owner << "You sent [input] to [H] via a secure channel."
|
||||
@@ -1405,6 +1405,7 @@
|
||||
var/mob/sender = locate(href_list["CentcommFaxReply"])
|
||||
var/obj/machinery/photocopier/faxmachine/fax = locate(href_list["originfax"])
|
||||
|
||||
//todo: sanitize
|
||||
var/input = input(src.owner, "Please enter a message to reply to [key_name(sender)] via secure connection. NOTE: BBCode does not work, but HTML tags do! Use <br> for line breaks.", "Outgoing message from Centcomm", "") as message|null
|
||||
if(!input) return
|
||||
|
||||
@@ -2388,9 +2389,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"])
|
||||
@@ -2423,13 +2422,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"])
|
||||
@@ -2471,15 +2468,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"])
|
||||
@@ -2584,7 +2577,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"])
|
||||
@@ -2622,7 +2615,7 @@
|
||||
|
||||
if(href_list["add_player_info"])
|
||||
var/key = href_list["add_player_info"]
|
||||
var/add = input("Add Player Info") as null|text
|
||||
var/add = sanitize(input("Add Player Info") as null|text)
|
||||
if(!add) return
|
||||
|
||||
notes_add(key,add,usr)
|
||||
|
||||
@@ -23,7 +23,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
|
||||
//clean the input msg
|
||||
if(!msg)
|
||||
return
|
||||
msg = sanitize(copytext(msg,1,MAX_MESSAGE_LEN))
|
||||
msg = sanitize(msg)
|
||||
if(!msg)
|
||||
return
|
||||
var/original_msg = msg
|
||||
@@ -88,7 +88,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
|
||||
if(ai_found)
|
||||
ai_cl = " (<A HREF='?_src_=holder;adminchecklaws=\ref[mob]'>CL</A>)"
|
||||
|
||||
//Options bar: mob, details ( admin = 2, dev = 3, mentor = 4, character name (0 = just ckey, 1 = ckey and character name), link? (0 no don't make it a link, 1 do so),
|
||||
//Options bar: mob, details ( admin = 2, dev = 3, mentor = 4, character name (0 = just ckey, 1 = ckey and character name), link? (0 no don't make it a link, 1 do so),
|
||||
// highlight special roles (0 = everyone has same looking name, 1 = antags / special roles get a golden name)
|
||||
|
||||
var/mentor_msg = "\blue <b><font color=red>Request for Help: </font>[get_options_bar(mob, 4, 1, 1, 0)][ai_cl]:</b> [msg]"
|
||||
|
||||
@@ -60,8 +60,9 @@
|
||||
return
|
||||
|
||||
//clean the message if it's not sent by a high-rank admin
|
||||
//todo: sanitize for all???
|
||||
if(!check_rights(R_SERVER|R_DEBUG,0))
|
||||
msg = sanitize(copytext(msg,1,MAX_MESSAGE_LEN))
|
||||
msg = sanitize(msg)
|
||||
if(!msg) return
|
||||
|
||||
var/recieve_pm_type = "Player"
|
||||
@@ -91,7 +92,7 @@
|
||||
spawn(0) //so we don't hold the caller proc up
|
||||
var/sender = src
|
||||
var/sendername = key
|
||||
var/reply = input(C, msg,"[recieve_pm_type] PM from [sendername]", "") as text|null //show message and await a reply
|
||||
var/reply = sanitize(input(C, msg,"[recieve_pm_type] PM from [sendername]", "") as text|null) //show message and await a reply
|
||||
if(C && reply)
|
||||
if(sender)
|
||||
C.cmd_admin_pm(sender,reply) //sender is still about, let's reply to them
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
set hidden = 1
|
||||
if(!check_rights(R_ADMIN)) return
|
||||
|
||||
msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
|
||||
msg = sanitize(msg)
|
||||
if(!msg) return
|
||||
|
||||
log_admin("[key_name(src)] : [msg]")
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
if(!check_rights(R_ADMIN|R_MOD|R_MENTOR)) return
|
||||
|
||||
msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
|
||||
msg = sanitize(msg)
|
||||
log_admin("MOD: [key_name(src)] : [msg]")
|
||||
|
||||
if (!msg)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
if(!check_rights(R_ADMIN)) return
|
||||
|
||||
msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
|
||||
msg = sanitize(msg)
|
||||
if(!msg) return
|
||||
|
||||
var/display_name = src.key
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
src << "Only administrators may use this command."
|
||||
return
|
||||
|
||||
var/input = input(usr, "Enter the description of the custom event. Be descriptive. To cancel the event, make this blank or hit cancel.", "Custom Event", custom_event_msg) as message|null
|
||||
var/input = sanitize(input(usr, "Enter the description of the custom event. Be descriptive. To cancel the event, make this blank or hit cancel.", "Custom Event", custom_event_msg) as message|null, MAX_BOOK_MESSAGE_LEN, extra = 0)
|
||||
if(!input || input == "")
|
||||
custom_event_msg = null
|
||||
log_admin("[usr.key] has cleared the custom event text.")
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
world << "<h1 class='alert'>Custom Event</h1>"
|
||||
world << "<h2 class='alert'>A custom event is starting. OOC Info:</h2>"
|
||||
world << "<span class='alert'>[html_encode(custom_event_msg)]</span>"
|
||||
world << "<span class='alert'>[custom_event_msg]</span>"
|
||||
world << "<br>"
|
||||
|
||||
// normal verb for players to view info
|
||||
@@ -36,5 +36,5 @@
|
||||
|
||||
src << "<h1 class='alert'>Custom Event</h1>"
|
||||
src << "<h2 class='alert'>A custom event is taking place. OOC Info:</h2>"
|
||||
src << "<span class='alert'>[html_encode(custom_event_msg)]</span>"
|
||||
src << "<span class='alert'>[custom_event_msg]</span>"
|
||||
src << "<br>"
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
if (src.holder.rights & R_ADMIN)
|
||||
stafftype = "ADMIN"
|
||||
|
||||
msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
|
||||
msg = sanitize(msg)
|
||||
log_admin("[key_name(src)] : [msg]")
|
||||
|
||||
if (!msg)
|
||||
|
||||
@@ -205,7 +205,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
|
||||
return 0
|
||||
var/obj/item/device/paicard/card = new(T)
|
||||
var/mob/living/silicon/pai/pai = new(card)
|
||||
pai.name = input(choice, "Enter your pAI name:", "pAI Name", "Personal AI") as text
|
||||
pai.name = sanitizeSafe(input(choice, "Enter your pAI name:", "pAI Name", "Personal AI") as text)
|
||||
pai.real_name = pai.name
|
||||
pai.key = choice.key
|
||||
card.setPersonality(pai)
|
||||
|
||||
@@ -168,7 +168,7 @@
|
||||
return .(O.vars[variable])
|
||||
|
||||
if("text")
|
||||
var/new_value = input("Enter new text:","Text",O.vars[variable]) as text|null
|
||||
var/new_value = input("Enter new text:","Text",O.vars[variable]) as text|null//todo: sanitize ???
|
||||
if(new_value == null) return
|
||||
O.vars[variable] = new_value
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ var/list/forbidden_varedit_object_types = list(
|
||||
switch(class)
|
||||
|
||||
if("text")
|
||||
var_value = input("Enter new text:","Text") as null|text
|
||||
var_value = input("Enter new text:","Text") as null|text//todo: sanitize ???
|
||||
|
||||
if("num")
|
||||
var_value = input("Enter new number:","Num") as null|num
|
||||
@@ -93,7 +93,7 @@ var/list/forbidden_varedit_object_types = list(
|
||||
switch(class)
|
||||
|
||||
if("text")
|
||||
var_value = input("Enter new text:","Text") as text
|
||||
var_value = input("Enter new text:","Text") as text//todo: sanitize ???
|
||||
|
||||
if("num")
|
||||
var_value = input("Enter new number:","Num") as num
|
||||
@@ -243,7 +243,7 @@ var/list/forbidden_varedit_object_types = list(
|
||||
return
|
||||
|
||||
if("text")
|
||||
L[L.Find(variable)] = input("Enter new text:","Text") as text
|
||||
L[L.Find(variable)] = input("Enter new text:","Text") as text//todo: sanitize ???
|
||||
|
||||
if("num")
|
||||
L[L.Find(variable)] = input("Enter new number:","Num") as num
|
||||
@@ -450,7 +450,7 @@ var/list/forbidden_varedit_object_types = list(
|
||||
return .(O.vars[variable])
|
||||
|
||||
if("text")
|
||||
var/var_new = input("Enter new text:","Text",O.vars[variable]) as null|text
|
||||
var/var_new = input("Enter new text:","Text",O.vars[variable]) as null|text//todo: sanitize ???
|
||||
if(var_new==null) return
|
||||
O.vars[variable] = var_new
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
usr << "\red Speech is currently admin-disabled."
|
||||
return
|
||||
|
||||
msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
|
||||
msg = sanitize(msg)
|
||||
if(!msg) return
|
||||
|
||||
if(usr.client)
|
||||
@@ -29,14 +29,14 @@
|
||||
//log_admin("HELP: [key_name(src)]: [msg]")
|
||||
|
||||
/proc/Centcomm_announce(var/text , var/mob/Sender , var/iamessage)
|
||||
var/msg = sanitize(copytext(text, 1, MAX_MESSAGE_LEN))
|
||||
var/msg = sanitize(text)
|
||||
msg = "\blue <b><font color=orange>CENTCOMM[iamessage ? " IA" : ""]:</font>[key_name(Sender, 1)] (<A HREF='?_src_=holder;adminplayeropts=\ref[Sender]'>PP</A>) (<A HREF='?_src_=vars;Vars=\ref[Sender]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=\ref[Sender]'>SM</A>) (<A HREF='?_src_=holder;adminplayerobservejump=\ref[Sender]'>JMP</A>) (<A HREF='?_src_=holder;secretsadmin=check_antagonist'>CA</A>) (<A HREF='?_src_=holder;BlueSpaceArtillery=\ref[Sender]'>BSA</A>) (<A HREF='?_src_=holder;CentcommReply=\ref[Sender]'>RPLY</A>):</b> [msg]"
|
||||
for(var/client/C in admins)
|
||||
if(R_ADMIN & C.holder.rights)
|
||||
C << msg
|
||||
|
||||
/proc/Syndicate_announce(var/text , var/mob/Sender)
|
||||
var/msg = sanitize(copytext(text, 1, MAX_MESSAGE_LEN))
|
||||
var/msg = sanitize(text)
|
||||
msg = "\blue <b><font color=crimson>ILLEGAL:</font>[key_name(Sender, 1)] (<A HREF='?_src_=holder;adminplayeropts=\ref[Sender]'>PP</A>) (<A HREF='?_src_=vars;Vars=\ref[Sender]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=\ref[Sender]'>SM</A>) (<A HREF='?_src_=holder;adminplayerobservejump=\ref[Sender]'>JMP</A>) (<A HREF='?_src_=holder;secretsadmin=check_antagonist'>CA</A>) (<A HREF='?_src_=holder;BlueSpaceArtillery=\ref[Sender]'>BSA</A>) (<A HREF='?_src_=holder;SyndicateReply=\ref[Sender]'>RPLY</A>):</b> [msg]"
|
||||
for(var/client/C in admins)
|
||||
if(R_ADMIN & C.holder.rights)
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
src << "Only administrators may use this command."
|
||||
return
|
||||
|
||||
var/msg = input("Message:", text("Subtle PM to [M.key]")) as text
|
||||
var/msg = sanitize(input("Message:", text("Subtle PM to [M.key]")) as text)
|
||||
|
||||
if (!msg)
|
||||
return
|
||||
@@ -109,7 +109,7 @@
|
||||
src << "Only administrators may use this command."
|
||||
return
|
||||
|
||||
var/msg = input("Message:", text("Enter the text you wish to appear to everyone:")) as text
|
||||
var/msg = sanitize(input("Message:", text("Enter the text you wish to appear to everyone:")) as text)
|
||||
|
||||
if (!msg)
|
||||
return
|
||||
@@ -132,7 +132,7 @@
|
||||
if(!M)
|
||||
return
|
||||
|
||||
var/msg = input("Message:", text("Enter the text you wish to appear to your target:")) as text
|
||||
var/msg = sanitize(input("Message:", text("Enter the text you wish to appear to your target:")) as text)
|
||||
|
||||
if( !msg )
|
||||
return
|
||||
@@ -462,7 +462,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
if(!holder)
|
||||
src << "Only administrators may use this command."
|
||||
return
|
||||
var/input = input(usr, "Please enter anything you want the AI to do. Anything. Serious.", "What?", "") as text|null
|
||||
var/input = sanitize(input(usr, "Please enter anything you want the AI to do. Anything. Serious.", "What?", "") as text|null)
|
||||
if(!input)
|
||||
return
|
||||
for(var/mob/living/silicon/ai/M in mob_list)
|
||||
@@ -510,8 +510,8 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
if(!holder)
|
||||
src << "Only administrators may use this command."
|
||||
return
|
||||
var/input = input(usr, "Please enter anything you want. Anything. Serious.", "What?", "") as message|null
|
||||
var/customname = input(usr, "Pick a title for the report.", "Title") as text|null
|
||||
var/input = sanitize(input(usr, "Please enter anything you want. Anything. Serious.", "What?", "") as message|null, extra = 0)
|
||||
var/customname = sanitizeSafe(input(usr, "Pick a title for the report.", "Title") as text|null)
|
||||
if(!input)
|
||||
return
|
||||
if(!customname)
|
||||
|
||||
@@ -43,7 +43,7 @@ var/const/commandos_possible = 6 //if more Commandos are needed in the future
|
||||
|
||||
choice = null
|
||||
while(!choice)
|
||||
choice = sanitize(copytext(input(src, "Please specify which mission the strike team shall undertake.", "Specify Mission", ""),1,MAX_MESSAGE_LEN))
|
||||
choice = sanitize(input(src, "Please specify which mission the strike team shall undertake.", "Specify Mission", ""))
|
||||
if(!choice)
|
||||
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
|
||||
return
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
if(custom_event_msg && custom_event_msg != "")
|
||||
src << "<h1 class='alert'>Custom Event</h1>"
|
||||
src << "<h2 class='alert'>A custom event is taking place. OOC Info:</h2>"
|
||||
src << "<span class='alert'>[html_encode(custom_event_msg)]</span>"
|
||||
src << "<span class='alert'>[custom_event_msg]</span>"
|
||||
src << "<br>"
|
||||
|
||||
if( (world.address == address || !address) && !host )
|
||||
|
||||
@@ -995,16 +995,10 @@ datum/preferences
|
||||
ShowChoices(user)
|
||||
return
|
||||
if("general")
|
||||
var/msg = input(usr,"Give a general description of your character. This will be shown regardless of clothing, and may include OOC notes and preferences.","Flavor Text",html_decode(flavor_texts[href_list["task"]])) as message
|
||||
if(msg != null)
|
||||
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
|
||||
msg = html_encode(msg)
|
||||
var/msg = sanitize(input(usr,"Give a general description of your character. This will be shown regardless of clothing, and may include OOC notes and preferences.","Flavor Text",html_decode(flavor_texts[href_list["task"]])) as message, extra = 0)
|
||||
flavor_texts[href_list["task"]] = msg
|
||||
else
|
||||
var/msg = input(usr,"Set the flavor text for your [href_list["task"]].","Flavor Text",html_decode(flavor_texts[href_list["task"]])) as message
|
||||
if(msg != null)
|
||||
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
|
||||
msg = html_encode(msg)
|
||||
var/msg = sanitize(input(usr,"Set the flavor text for your [href_list["task"]].","Flavor Text",html_decode(flavor_texts[href_list["task"]])) as message, extra = 0)
|
||||
flavor_texts[href_list["task"]] = msg
|
||||
SetFlavorText(user)
|
||||
return
|
||||
@@ -1019,16 +1013,10 @@ datum/preferences
|
||||
ShowChoices(user)
|
||||
return
|
||||
if("Default")
|
||||
var/msg = input(usr,"Set the default flavour text for your robot. It will be used for any module without individual setting.","Flavour Text",html_decode(flavour_texts_robot["Default"])) as message
|
||||
if(msg != null)
|
||||
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
|
||||
msg = html_encode(msg)
|
||||
var/msg = sanitize(input(usr,"Set the default flavour text for your robot. It will be used for any module without individual setting.","Flavour Text",html_decode(flavour_texts_robot["Default"])) as message, extra = 0)
|
||||
flavour_texts_robot[href_list["task"]] = msg
|
||||
else
|
||||
var/msg = input(usr,"Set the flavour text for your robot with [href_list["task"]] module. If you leave this empty, default flavour text will be used for this module.","Flavour Text",html_decode(flavour_texts_robot[href_list["task"]])) as message
|
||||
if(msg != null)
|
||||
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
|
||||
msg = html_encode(msg)
|
||||
var/msg = sanitize(input(usr,"Set the flavour text for your robot with [href_list["task"]] module. If you leave this empty, default flavour text will be used for this module.","Flavour Text",html_decode(flavour_texts_robot[href_list["task"]])) as message, extra = 0)
|
||||
flavour_texts_robot[href_list["task"]] = msg
|
||||
SetFlavourTextRobot(user)
|
||||
return
|
||||
@@ -1044,41 +1032,25 @@ datum/preferences
|
||||
else
|
||||
user << browse(null, "window=records")
|
||||
if(href_list["task"] == "med_record")
|
||||
var/medmsg = input(usr,"Set your medical notes here.","Medical Records",html_decode(med_record)) as message
|
||||
|
||||
var/medmsg = sanitize(input(usr,"Set your medical notes here.","Medical Records",html_decode(med_record)) as message, MAX_PAPER_MESSAGE_LEN, extra = 0)
|
||||
if(medmsg != null)
|
||||
medmsg = copytext(medmsg, 1, MAX_PAPER_MESSAGE_LEN)
|
||||
medmsg = html_encode(medmsg)
|
||||
|
||||
med_record = medmsg
|
||||
SetRecords(user)
|
||||
|
||||
if(href_list["task"] == "sec_record")
|
||||
var/secmsg = input(usr,"Set your security notes here.","Security Records",html_decode(sec_record)) as message
|
||||
|
||||
var/secmsg = sanitize(input(usr,"Set your security notes here.","Security Records",html_decode(sec_record)) as message, MAX_PAPER_MESSAGE_LEN, extra = 0)
|
||||
if(secmsg != null)
|
||||
secmsg = copytext(secmsg, 1, MAX_PAPER_MESSAGE_LEN)
|
||||
secmsg = html_encode(secmsg)
|
||||
|
||||
sec_record = secmsg
|
||||
SetRecords(user)
|
||||
if(href_list["task"] == "gen_record")
|
||||
var/genmsg = input(usr,"Set your employment notes here.","Employment Records",html_decode(gen_record)) as message
|
||||
|
||||
var/genmsg = sanitize(input(usr,"Set your employment notes here.","Employment Records",html_decode(gen_record)) as message, MAX_PAPER_MESSAGE_LEN, extra = 0)
|
||||
if(genmsg != null)
|
||||
genmsg = copytext(genmsg, 1, MAX_PAPER_MESSAGE_LEN)
|
||||
genmsg = html_encode(genmsg)
|
||||
|
||||
gen_record = genmsg
|
||||
SetRecords(user)
|
||||
|
||||
if(href_list["task"] == "exploitable_record")
|
||||
var/exploitmsg = input(usr,"Set exploitable information about you here.","Exploitable Information",html_decode(exploit_record)) as message
|
||||
|
||||
var/exploitmsg = sanitize(input(usr,"Set exploitable information about you here.","Exploitable Information",html_decode(exploit_record)) as message, MAX_PAPER_MESSAGE_LEN, extra = 0)
|
||||
if(exploitmsg != null)
|
||||
exploitmsg = copytext(exploitmsg, 1, MAX_PAPER_MESSAGE_LEN)
|
||||
exploitmsg = html_encode(exploitmsg)
|
||||
|
||||
exploit_record = exploitmsg
|
||||
SetAntagoptions(user)
|
||||
|
||||
@@ -1205,7 +1177,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
|
||||
@@ -1291,7 +1263,7 @@ datum/preferences
|
||||
if("metadata")
|
||||
var/new_metadata = input(user, "Enter any information you'd like others to see, such as Roleplay-preferences:", "Game Preference" , metadata) as message|null
|
||||
if(new_metadata)
|
||||
metadata = sanitize(copytext(new_metadata,1,MAX_MESSAGE_LEN))
|
||||
metadata = sanitize(new_metadata)
|
||||
|
||||
if("b_type")
|
||||
var/new_b_type = input(user, "Choose your character's blood-type:", "Character Preference") as null|anything in list( "A+", "A-", "B+", "B-", "AB+", "AB-", "O+", "O-" )
|
||||
@@ -1504,7 +1476,7 @@ datum/preferences
|
||||
if(choice == "Other")
|
||||
var/raw_choice = input(user, "Please enter a home system.") as text|null
|
||||
if(raw_choice)
|
||||
home_system = sanitize(copytext(raw_choice,1,MAX_MESSAGE_LEN))
|
||||
home_system = sanitize(raw_choice)
|
||||
return
|
||||
home_system = choice
|
||||
if("citizenship")
|
||||
@@ -1514,7 +1486,7 @@ datum/preferences
|
||||
if(choice == "Other")
|
||||
var/raw_choice = input(user, "Please enter your current citizenship.", "Character Preference") as text|null
|
||||
if(raw_choice)
|
||||
citizenship = sanitize(copytext(raw_choice,1,MAX_MESSAGE_LEN))
|
||||
citizenship = sanitize(raw_choice)
|
||||
return
|
||||
citizenship = choice
|
||||
if("faction")
|
||||
@@ -1524,7 +1496,7 @@ datum/preferences
|
||||
if(choice == "Other")
|
||||
var/raw_choice = input(user, "Please enter a faction.") as text|null
|
||||
if(raw_choice)
|
||||
faction = sanitize(copytext(raw_choice,1,MAX_MESSAGE_LEN))
|
||||
faction = sanitize(raw_choice)
|
||||
return
|
||||
faction = choice
|
||||
if("religion")
|
||||
@@ -1534,7 +1506,7 @@ datum/preferences
|
||||
if(choice == "Other")
|
||||
var/raw_choice = input(user, "Please enter a religon.") as text|null
|
||||
if(raw_choice)
|
||||
religion = sanitize(copytext(raw_choice,1,MAX_MESSAGE_LEN))
|
||||
religion = sanitize(raw_choice)
|
||||
return
|
||||
religion = choice
|
||||
else
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
|
||||
var/voice = sanitize(copytext(name,1,MAX_MESSAGE_LEN))
|
||||
var/voice = sanitize(name, MAX_NAME_LEN)
|
||||
if(!voice || !length(voice)) return
|
||||
changer.voice = voice
|
||||
usr << "<span class='notice'>You are now mimicking <B>[changer.voice]</B>.</span>"
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
|
||||
/obj/item/rig_module/chem_dispenser/ninja
|
||||
interface_desc = "Dispenses loaded chemicals directly into the wearer's bloodstream. This variant is made to be extremely light and flexible."
|
||||
|
||||
|
||||
//just over a syringe worth of each. Want more? Go refill. Gives the ninja another reason to have to show their face.
|
||||
charges = list(
|
||||
list("tricordrazine", "tricordrazine", 0, 20),
|
||||
@@ -280,10 +280,10 @@
|
||||
voice_holder.active = 0
|
||||
usr << "<font color='blue'>You disable the speech synthesiser.</font>"
|
||||
if("Set Name")
|
||||
var/raw_choice = input(usr, "Please enter a new name.") as text|null
|
||||
var/raw_choice = sanitize(input(usr, "Please enter a new name.") as text|null)
|
||||
if(!raw_choice)
|
||||
return 0
|
||||
voice_holder.voice = sanitize(copytext(raw_choice,1,MAX_MESSAGE_LEN))
|
||||
voice_holder.voice = raw_choice
|
||||
usr << "<font color='blue'>You are now mimicking <B>[voice_holder.voice]</B>.</font>"
|
||||
return 1
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
if("change_id")
|
||||
var/attempt_code = text2num(input("Re-enter the current EFTPOS access code", "Confirm EFTPOS code"))
|
||||
if(attempt_code == access_code)
|
||||
eftpos_name = input("Enter a new terminal ID for this device", "Enter new EFTPOS ID") + " EFTPOS scanner"
|
||||
eftpos_name = sanitize(input("Enter a new terminal ID for this device", "Enter new EFTPOS ID")) + " EFTPOS scanner"
|
||||
print_reference()
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>Incorrect code entered.</span>"
|
||||
@@ -182,7 +182,7 @@
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>Account not found.</span>"
|
||||
if("trans_purpose")
|
||||
var/choice = input("Enter reason for EFTPOS transaction", "Transaction purpose")
|
||||
var/choice = sanitize(input("Enter reason for EFTPOS transaction", "Transaction purpose"))
|
||||
if(choice) transaction_purpose = choice
|
||||
if("trans_value")
|
||||
var/try_num = input("Enter amount for EFTPOS transaction", "Transaction amount") as num
|
||||
|
||||
@@ -233,7 +233,7 @@
|
||||
else if(href_list["back"])
|
||||
selected_event_container = null
|
||||
else if(href_list["set_name"])
|
||||
var/name = input("Enter event name.", "Set Name") as text|null
|
||||
var/name = sanitize(input("Enter event name.", "Set Name") as text|null)
|
||||
if(name)
|
||||
var/datum/event_meta/EM = locate(href_list["set_name"])
|
||||
EM.name = name
|
||||
|
||||
@@ -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 ([sanitize(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
|
||||
|
||||
@@ -300,12 +300,12 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
|
||||
if(checkoutperiod < 1)
|
||||
checkoutperiod = 1
|
||||
if(href_list["editbook"])
|
||||
buffer_book = sanitize(copytext(input("Enter the book's title:") as text|null,1,MAX_MESSAGE_LEN))
|
||||
buffer_book = sanitizeSafe(input("Enter the book's title:") as text|null)
|
||||
if(href_list["editmob"])
|
||||
buffer_mob = sanitize(copytext(input("Enter the recipient's name:") as text|null,1,MAX_NAME_LEN))
|
||||
buffer_mob = sanitize(input("Enter the recipient's name:") as text|null, MAX_NAME_LEN)
|
||||
if(href_list["checkout"])
|
||||
var/datum/borrowbook/b = new /datum/borrowbook
|
||||
b.bookname = sanitize(buffer_book)
|
||||
b.bookname = sanitizeSafe(buffer_book)
|
||||
b.mobname = sanitize(buffer_mob)
|
||||
b.getdate = world.time
|
||||
b.duedate = world.time + (checkoutperiod * 600)
|
||||
@@ -317,7 +317,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
|
||||
var/obj/item/weapon/book/b = locate(href_list["delbook"])
|
||||
inventory.Remove(b)
|
||||
if(href_list["setauthor"])
|
||||
var/newauthor = sanitize(copytext(input("Enter the author's name: ") as text|null,1,MAX_MESSAGE_LEN))
|
||||
var/newauthor = sanitize(input("Enter the author's name: ") as text|null)
|
||||
if(newauthor)
|
||||
scanner.cache.author = newauthor
|
||||
if(href_list["setcategory"])
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
var/input
|
||||
if(!message)
|
||||
input = sanitize(copytext(input(src,"Choose an emote to display.") as text|null,1,MAX_MESSAGE_LEN))
|
||||
input = sanitize(input(src,"Choose an emote to display.") as text|null)
|
||||
else
|
||||
input = message
|
||||
if(input)
|
||||
@@ -108,7 +108,7 @@
|
||||
|
||||
var/input
|
||||
if(!message)
|
||||
input = sanitize(copytext(input(src, "Choose an emote to display.") as text|null, 1, MAX_MESSAGE_LEN))
|
||||
input = sanitize(input(src, "Choose an emote to display.") as text|null)
|
||||
else
|
||||
input = message
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -32,5 +32,5 @@
|
||||
if(istype(container, /obj/item/device/mmi/radio_enabled))
|
||||
var/obj/item/device/mmi/radio_enabled/R = container
|
||||
if(R.radio)
|
||||
spawn(0) R.radio.hear_talk(src, trim(sanitize(message)), verb, speaking)
|
||||
spawn(0) R.radio.hear_talk(src, sanitize(message), verb, speaking)
|
||||
..(trim(message), speaking, verb)
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
m_type = 1
|
||||
|
||||
if ("custom")
|
||||
var/input = sanitize(copytext(input("Choose an emote to display.") as text|null,1,MAX_MESSAGE_LEN))
|
||||
var/input = sanitize(input("Choose an emote to display.") as text|null)
|
||||
if (!input)
|
||||
return
|
||||
var/input2 = input("Is this a visible or hearable emote?") in list("Visible","Hearable")
|
||||
@@ -577,7 +577,7 @@
|
||||
set desc = "Sets a description which will be shown when someone examines you."
|
||||
set category = "IC"
|
||||
|
||||
pose = sanitize(copytext(input(usr, "This is [src]. \He is...", "Pose", null) as text, 1, MAX_MESSAGE_LEN))
|
||||
pose = sanitize(input(usr, "This is [src]. \He is...", "Pose", null) as text)
|
||||
|
||||
/mob/living/carbon/human/verb/set_flavor()
|
||||
set name = "Set Flavour Text"
|
||||
|
||||
@@ -501,7 +501,7 @@
|
||||
for (var/datum/data/record/R in data_core.security)
|
||||
if (R.fields["id"] == E.fields["id"])
|
||||
if(hasHUD(usr,"security"))
|
||||
var/t1 = sanitize(copytext(input("Add Comment:", "Sec. records", null, null) as message,1,MAX_MESSAGE_LEN))
|
||||
var/t1 = sanitize(input("Add Comment:", "Sec. records", null, null) as message)
|
||||
if ( !(t1) || usr.stat || usr.restrained() || !(hasHUD(usr,"security")) )
|
||||
return
|
||||
var/counter = 1
|
||||
@@ -630,7 +630,7 @@
|
||||
for (var/datum/data/record/R in data_core.medical)
|
||||
if (R.fields["id"] == E.fields["id"])
|
||||
if(hasHUD(usr,"medical"))
|
||||
var/t1 = sanitize(copytext(input("Add Comment:", "Med. records", null, null) as message,1,MAX_MESSAGE_LEN))
|
||||
var/t1 = sanitize(input("Add Comment:", "Med. records", null, null) as message)
|
||||
if ( !(t1) || usr.stat || usr.restrained() || !(hasHUD(usr,"medical")) )
|
||||
return
|
||||
var/counter = 1
|
||||
@@ -657,17 +657,11 @@
|
||||
src << browse(null, "window=flavor_changes")
|
||||
return
|
||||
if("general")
|
||||
var/msg = input(usr,"Update the general description of your character. This will be shown regardless of clothing, and may include OOC notes and preferences.","Flavor Text",html_decode(flavor_texts[href_list["flavor_change"]])) as message
|
||||
if(msg != null)
|
||||
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
|
||||
msg = html_encode(msg)
|
||||
var/msg = sanitize(input(usr,"Update the general description of your character. This will be shown regardless of clothing, and may include OOC notes and preferences.","Flavor Text",html_decode(flavor_texts[href_list["flavor_change"]])) as message, extra = 0)
|
||||
flavor_texts[href_list["flavor_change"]] = msg
|
||||
return
|
||||
else
|
||||
var/msg = input(usr,"Update the flavor text for your [href_list["flavor_change"]].","Flavor Text",html_decode(flavor_texts[href_list["flavor_change"]])) as message
|
||||
if(msg != null)
|
||||
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
|
||||
msg = html_encode(msg)
|
||||
var/msg = sanitize(input(usr,"Update the flavor text for your [href_list["flavor_change"]].","Flavor Text",html_decode(flavor_texts[href_list["flavor_change"]])) as message, extra = 0)
|
||||
flavor_texts[href_list["flavor_change"]] = msg
|
||||
set_flavor()
|
||||
return
|
||||
@@ -1205,7 +1199,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)
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
|
||||
text = input("What would you like to say?", "Speak to creature", null, null)
|
||||
|
||||
text = trim(sanitize(copytext(text, 1, MAX_MESSAGE_LEN)))
|
||||
text = sanitize(text)
|
||||
|
||||
if(!text) return
|
||||
|
||||
@@ -213,7 +213,7 @@
|
||||
set desc = "Whisper silently to someone over a distance."
|
||||
set category = "Abilities"
|
||||
|
||||
var/msg = sanitize(copytext(input("Message:", "Psychic Whisper") as text|null, 1, MAX_MESSAGE_LEN))
|
||||
var/msg = sanitize(input("Message:", "Psychic Whisper") as text|null)
|
||||
if(msg)
|
||||
log_say("PsychicWhisper: [key_name(src)]->[M.key] : [msg]")
|
||||
M << "\green You hear a strange, alien voice in your head... \italic [msg]"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
pet.colour = "[M.colour]"
|
||||
user <<"You feed the slime the potion, removing it's powers and calming it."
|
||||
del(M)
|
||||
var/newname = sanitize(copytext(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text,1,MAX_NAME_LEN))
|
||||
var/newname = sanitize(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text, MAX_NAME_LEN)
|
||||
|
||||
if (!newname)
|
||||
newname = "pet slime"
|
||||
@@ -177,7 +177,7 @@
|
||||
pet.colour = "[M.colour]"
|
||||
user <<"You feed the slime the potion, removing it's powers and calming it."
|
||||
del(M)
|
||||
var/newname = sanitize(copytext(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text,1,MAX_NAME_LEN))
|
||||
var/newname = sanitize(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text, MAX_NAME_LEN)
|
||||
|
||||
if (!newname)
|
||||
newname = "pet slime"
|
||||
|
||||
@@ -57,32 +57,32 @@ var/datum/paiController/paiController // Global handler for pAI candidates
|
||||
if("name")
|
||||
t = input("Enter a name for your pAI", "pAI Name", candidate.name) as text
|
||||
if(t)
|
||||
candidate.name = sanitize(copytext(t,1,MAX_NAME_LEN))
|
||||
candidate.name = sanitizeSafe(t, MAX_NAME_LEN)
|
||||
if("desc")
|
||||
t = input("Enter a description for your pAI", "pAI Description", candidate.description) as message
|
||||
if(t)
|
||||
candidate.description = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
|
||||
candidate.description = sanitize(t)
|
||||
if("role")
|
||||
t = input("Enter a role for your pAI", "pAI Role", candidate.role) as text
|
||||
if(t)
|
||||
candidate.role = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
|
||||
candidate.role = sanitize(t)
|
||||
if("ooc")
|
||||
t = input("Enter any OOC comments", "pAI OOC Comments", candidate.comments) as message
|
||||
if(t)
|
||||
candidate.comments = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
|
||||
candidate.comments = sanitize(t)
|
||||
if("save")
|
||||
candidate.savefile_save(usr)
|
||||
if("load")
|
||||
candidate.savefile_load(usr)
|
||||
//In case people have saved unsanitized stuff.
|
||||
if(candidate.name)
|
||||
candidate.name = sanitize(copytext(candidate.name,1,MAX_NAME_LEN))
|
||||
candidate.name = sanitizeSafe(candidate.name, MAX_NAME_LEN)
|
||||
if(candidate.description)
|
||||
candidate.description = sanitize(copytext(candidate.description,1,MAX_MESSAGE_LEN))
|
||||
candidate.description = sanitize(candidate.description)
|
||||
if(candidate.role)
|
||||
candidate.role = sanitize(copytext(candidate.role,1,MAX_MESSAGE_LEN))
|
||||
candidate.role = sanitize(candidate.role)
|
||||
if(candidate.comments)
|
||||
candidate.comments = sanitize(copytext(candidate.comments,1,MAX_MESSAGE_LEN))
|
||||
candidate.comments = sanitize(candidate.comments)
|
||||
|
||||
if("submit")
|
||||
if(candidate)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user