Merge pull request #11515 from Tayyyyyyy/sanitize

Sanitize all inputs
This commit is contained in:
variableundefined
2019-08-11 22:09:10 +08:00
committed by GitHub
37 changed files with 90 additions and 79 deletions
+2 -2
View File
@@ -498,7 +498,7 @@ var/list/ai_verbs_default = list(
if(check_unable(AI_CHECK_WIRELESS))
return
var/input = input(usr, "Please enter the reason for calling the shuttle.", "Shuttle Call Reason.","") as text|null
var/input = clean_input("Please enter the reason for calling the shuttle.", "Shuttle Call Reason.","")
if(!input || stat)
return
@@ -1074,7 +1074,7 @@ var/list/ai_verbs_default = list(
set desc = "Change the message that's transmitted when a new crew member arrives on station."
set category = "AI Commands"
var/newmsg = input("What would you like the arrival message to be? List of options: $name, $rank, $species, $gender, $age", "Change Arrival Message", arrivalmsg) as text
var/newmsg = clean_input("What would you like the arrival message to be? List of options: $name, $rank, $species, $gender, $age", "Change Arrival Message", arrivalmsg)
if(newmsg != arrivalmsg)
arrivalmsg = newmsg
to_chat(usr, "The arrival message has been successfully changed.")
+1 -1
View File
@@ -99,7 +99,7 @@ var/const/VOX_PATH = "sound/vox_fem/"
to_chat(src, "<span class='warning'>Please wait [round((announcing_vox - world.time) / 10)] seconds.</span>")
return
var/message = input(src, "WARNING: Misuse of this verb can result in you being job banned. More help is available in 'Announcement Help'", "Announcement", last_announcement) as text|null
var/message = clean_input("WARNING: Misuse of this verb can result in you being job banned. More help is available in 'Announcement Help'", "Announcement", last_announcement, src)
last_announcement = message
+2 -2
View File
@@ -567,9 +567,9 @@ var/list/intents = list(INTENT_HELP,INTENT_DISARM,INTENT_GRAB,INTENT_HARM)
for(var/i=1,i<=3,i++) //we get 3 attempts to pick a suitable name.
if(force)
newname = input(src, "Pick a new name.", "Name Change", oldname) as text
newname = clean_input("Pick a new name.", "Name Change", oldname, src)
else
newname = input(src, "You are a [role]. Would you like to change your name to something else? (You have 3 minutes to select a new name.)", "Name Change", oldname) as text
newname = input("You are a [role]. Would you like to change your name to something else? (You have 3 minutes to select a new name.)", "Name Change", oldname, src)
if(((world.time - time_passed) > 1800) && !force)
alert(src, "Unfortunately, more than 3 minutes have passed for selecting your name. If you are a robot, use the Namepick verb; otherwise, adminhelp.", "Name Change")
return //took too long
@@ -9,7 +9,7 @@
return
if(!new_type)
new_type = input("Mob type path:", "Mob type") as text|null
new_type = clean_input("Mob type path:", "Mob type")
if(istext(new_type))
new_type = text2path(new_type)