mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-22 04:24:20 +01:00
Allows admin announcements to have newlines
This commit is contained in:
@@ -323,7 +323,7 @@ proc/checkhtml(var/t)
|
||||
//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)
|
||||
/proc/strip_html_properly(var/input, var/max_length = MAX_MESSAGE_LEN, allow_lines = 0)
|
||||
if(!input)
|
||||
return
|
||||
var/opentag = 1 //These store the position of < and > respectively.
|
||||
@@ -345,10 +345,10 @@ proc/checkhtml(var/t)
|
||||
break
|
||||
if(max_length)
|
||||
input = copytext(input,1,max_length)
|
||||
return sanitize(input)
|
||||
return sanitize(input, allow_lines ? list("\t" = " ") : list("\n" = " ", "\t" = " "))
|
||||
|
||||
/proc/trim_strip_html_properly(var/input, var/max_length = MAX_MESSAGE_LEN)
|
||||
return trim(strip_html_properly(input, max_length))
|
||||
/proc/trim_strip_html_properly(var/input, var/max_length = MAX_MESSAGE_LEN, allow_lines = 0)
|
||||
return trim(strip_html_properly(input, max_length, allow_lines))
|
||||
|
||||
//Used in preferences' SetFlavorText and human's set_flavor verb
|
||||
//Previews a string of len or less length
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
var/tmp/message_sound = new_sound ? sound(new_sound) : sound
|
||||
|
||||
if(!msg_sanitized)
|
||||
message = trim_strip_html_properly(message)
|
||||
message = trim_strip_html_properly(message, allow_lines = 1)
|
||||
message_title = html_encode(message_title)
|
||||
|
||||
Message(message, message_title, from)
|
||||
|
||||
Reference in New Issue
Block a user