mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
Merge pull request #27089 from Exxion/'
Fixes extra html_encode() in pray and rambler vows
This commit is contained in:
@@ -35,14 +35,11 @@
|
||||
*/
|
||||
|
||||
//Simply removes < and > and limits the length of the message
|
||||
/proc/strip_html_simple(var/t,var/limit=MAX_MESSAGE_LEN)
|
||||
/proc/strip_html_simple(var/t, var/limit=MAX_MESSAGE_LEN)
|
||||
var/list/strip_chars = list("<",">")
|
||||
t = copytext(t,1,limit)
|
||||
t = copytext(t, 1, limit)
|
||||
for(var/char in strip_chars)
|
||||
var/index = findtext(t, char)
|
||||
while(index)
|
||||
t = copytext(t, 1, index) + copytext(t, index+1)
|
||||
index = findtext(t, char)
|
||||
t = replacetext(t, char, "")
|
||||
return t
|
||||
|
||||
/proc/strip_html_properly(input = "")
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
if(!target.mind)
|
||||
to_chat(user,"<span class='warning'>[target] has no mind!</span>")
|
||||
continue
|
||||
var/vow = copytext(sanitize(input(user, "Enter your vow. You have [R.remaining_vows] left.", "VOW LOCK IN") as null|text),1,MAX_MESSAGE_LEN)
|
||||
var/vow = stripped_input(user, "Enter your vow. You have [R.remaining_vows] left.", "VOW LOCK IN")
|
||||
if(vow)
|
||||
user.say("[target], I vow [vow].")
|
||||
user.say("VOW LOCKED IN!")
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
to_chat(usr, "<span class='warning'>Speech is currently admin-disabled.</span>")
|
||||
return
|
||||
|
||||
msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN)
|
||||
msg = strip_html_simple(msg)
|
||||
if(!msg)
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user