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
|
//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("<",">")
|
var/list/strip_chars = list("<",">")
|
||||||
t = copytext(t,1,limit)
|
t = copytext(t, 1, limit)
|
||||||
for(var/char in strip_chars)
|
for(var/char in strip_chars)
|
||||||
var/index = findtext(t, char)
|
t = replacetext(t, char, "")
|
||||||
while(index)
|
|
||||||
t = copytext(t, 1, index) + copytext(t, index+1)
|
|
||||||
index = findtext(t, char)
|
|
||||||
return t
|
return t
|
||||||
|
|
||||||
/proc/strip_html_properly(input = "")
|
/proc/strip_html_properly(input = "")
|
||||||
|
|||||||
@@ -153,7 +153,7 @@
|
|||||||
if(!target.mind)
|
if(!target.mind)
|
||||||
to_chat(user,"<span class='warning'>[target] has no mind!</span>")
|
to_chat(user,"<span class='warning'>[target] has no mind!</span>")
|
||||||
continue
|
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)
|
if(vow)
|
||||||
user.say("[target], I vow [vow].")
|
user.say("[target], I vow [vow].")
|
||||||
user.say("VOW LOCKED IN!")
|
user.say("VOW LOCKED IN!")
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
to_chat(usr, "<span class='warning'>Speech is currently admin-disabled.</span>")
|
to_chat(usr, "<span class='warning'>Speech is currently admin-disabled.</span>")
|
||||||
return
|
return
|
||||||
|
|
||||||
msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN)
|
msg = strip_html_simple(msg)
|
||||||
if(!msg)
|
if(!msg)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user