/tg/ input stripping.

Borrows /tg/ html stripping code.
Ghosts are the first to be given this boon, they now have to deliberately emote things like "Spooky man and it#36&;s friends type crap".
This commit is contained in:
PsiOmega
2014-11-21 18:19:04 +01:00
parent 843aa3c126
commit 7182ff9c3f
9 changed files with 35 additions and 13 deletions

View File

@@ -1,5 +1,5 @@
/mob/dead/observer/say(var/message)
message = sanitize(copytext(message, 1, MAX_MESSAGE_LEN))
message = strip_html_properly(message)
if (!message)
return
@@ -18,7 +18,7 @@
/mob/dead/observer/emote(var/act, var/type, var/message)
message = sanitize(copytext(message, 1, MAX_MESSAGE_LEN))
message = trim_strip_html_properly(message)
if(!message)
return

View File

@@ -7,7 +7,7 @@
src << "\red You cannot speak in IC (Muted)."
return
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
message = trim_strip_html_properly(message)
if(stat == 2)
return say_dead(message)

View File

@@ -10,7 +10,7 @@
src << "\red You cannot speak in IC (Muted)."
return
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
message = trim_strip_html_properly(message)
if(stat == 2)
return say_dead(message)

View File

@@ -5,7 +5,8 @@
if(say_disabled) //This is here to try to identify lag problems
usr << "\red Speech is currently admin-disabled."
return
message = trim_strip_html_properly(message)
log_whisper("[src.name]/[src.key] : [message]")
if (src.client)
@@ -21,8 +22,6 @@
if (src.stat)
return
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)) //made consistent with say
if(name != GetVoice())
alt_name = "(as [get_id_name("Unknown")])"

View File

@@ -34,7 +34,7 @@
if (src.client.handle_spam_prevention(message,MUTE_IC))
return 0
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
message = trim_strip_html_properly(message)
if (stat == 2)
return say_dead(message)

View File

@@ -14,7 +14,7 @@
if(istype(src.loc,/mob/living/simple_animal/borer))
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
message = trim_strip_html_properly(message)
if (!message)
return
log_say("[key_name(src)] : [message]")

View File

@@ -1,6 +1,6 @@
/mob/living/simple_animal/borer/say(var/message)
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
message = trim_strip_html_properly(message)
message = capitalize(message)
if(!message)

View File

@@ -24,7 +24,7 @@
usr << "\red Speech is currently admin-disabled."
return
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
message = strip_html_properly(message)
set_typing_indicator(0)
if(use_me)