Update reject_bad_name

This commit is contained in:
Tayyyyyyy
2019-07-14 10:00:09 -07:00
parent 57c700a814
commit 80b3cae41e
+4 -2
View File
@@ -130,8 +130,10 @@
//Filters out undesirable characters from names
/proc/reject_bad_name(var/t_in, var/allow_numbers=0, var/max_length=MAX_NAME_LEN)
// Decode so that names with characters like < are still rejected. Will be encoded again at the end
t_in = html_decode(t_in)
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
return //Rejects the input if it is null or if it is longer than the max length allowed
var/number_of_alphanumeric = 0
var/last_char_group = 0
@@ -190,7 +192,7 @@
for(var/bad_name in list("space","floor","wall","r-wall","monkey","unknown","inactive ai","plating")) //prevents these common metagamey names
if(cmptext(t_out,bad_name)) return //(not case sensitive)
return t_out
return html_encode(t_out)
//checks text for html tags
//if tag is not in whitelist (var/list/paper_tag_whitelist in global.dm)