TG: Sanitized a large number of input()s.

- Hopefully this will cut down on the server spamming/crashing escapades
happening on other servers. (This wont stop that from happening, this just makes
it less severe)
- Some of the sanitizes were probably unnecessary, but better safe then sorry.

Added MAX_NAME_LEN constant which is initialized to 26.
- Please use MAX_NAME_LEN instead of typing in 26 when cutting inputs short.
26's are annoying when they have to be changed and you have to hunt through over
a hundred files and tens of thousands of lines of code to find them all.

Moved uplink_kits.dm to code/game/objects/storage

Moved uplinks.dm to code/game/objects
- The stuff inside uplinks.dm could really be chopped up and split into separate
dm files but this will do for now.

*********************************************************
**********************Important**************************
*********************************************************
When you create code that asks the user for an input consider whether or not it
gets shown to the user through html or the like.

If it does please sanatize() or strip_html() it. Also use copytext() to cutoff
spam by using MAX_NAME_LEN and MAX_MESSAGE_LEN as the cutoff var.
Revision: r3652
Author: 	 johnsonmt88
This commit is contained in:
Erthilo
2012-05-26 00:09:56 +01:00
parent ca62d85b83
commit 6e289dabfc
40 changed files with 627 additions and 164 deletions
+2 -3
View File
@@ -968,11 +968,10 @@ var/global/BSACooldown = 0
if ((src.rank in list( "Trial Admin", "Badmin", "Game Admin", "Game Master" )))
var/mob/M = locate(href_list["forcespeech"])
if (ismob(M))
var/speech = input("What will [key_name(M)] say?.", "Force speech", "")
var/speech = copytext(sanitize(input("What will [key_name(M)] say?.", "Force speech", "")),1,MAX_MESSAGE_LEN)
if(!speech)
return
M.say(speech)
speech = copytext(sanitize(speech), 1, MAX_MESSAGE_LEN)
log_admin("[key_name(usr)] forced [key_name(M)] to say: [speech]")
message_admins("\blue [key_name_admin(usr)] forced [key_name_admin(M)] to say: [speech]")
else
@@ -1883,7 +1882,7 @@ var/global/BSACooldown = 0
if(!ticker)
alert("The game hasn't started yet!")
return
var/objective = input("Enter an objective")
var/objective = copytext(sanitize(input("Enter an objective")),1,MAX_MESSAGE_LEN)
if(!objective)
return
//feedback_inc("admin_secrets_fun_used",1)
+1 -1
View File
@@ -24,7 +24,7 @@ var/global/sent_strike_team = 0
var/input = null
while(!input)
input = input(src, "Please specify which mission the death commando squad shall undertake.", "Specify Mission", "") as text|null
input = copytext(sanitize(input(src, "Please specify which mission the death commando squad shall undertake.", "Specify Mission", "")),1,MAX_MESSAGE_LEN)
if(!input)
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
return
@@ -24,7 +24,7 @@ var/global/sent_syndicate_strike_team = 0
var/input = null
while(!input)
input = input(src, "Please specify which mission the syndicate strike team shall undertake.", "Specify Mission", "")
input = copytext(sanitize(input(src, "Please specify which mission the syndicate strike team shall undertake.", "Specify Mission", "")),1,MAX_MESSAGE_LEN)
if(!input)
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
return