Goonstation Forums
[Bug] Mechcomp signal HTML encoding/decoding - Printable Version

+- Goonstation Forums (https://forum.ss13.co)
+-- Forum: Discussion (https://forum.ss13.co/forumdisplay.php?fid=6)
+--- Forum: Patches (https://forum.ss13.co/forumdisplay.php?fid=30)
+---- Forum: Rejected (https://forum.ss13.co/forumdisplay.php?fid=33)
+---- Thread: [Bug] Mechcomp signal HTML encoding/decoding (/showthread.php?tid=6039)



[Bug] Mechcomp signal HTML encoding/decoding - Dabir - 03-08-2016

All strings put into mechcomps by users are run through adminscrub(), which puts them through html_encode() as its final step having html_decoded them as its first. This leads to issues when trying to send signals over wifi, you end up with things like this:
Code:
command=text_message&sender_name=Man Jackson&message=This&#ȝ9;s a test.

Which end up getting interpreted as something like
Code:
command=text_message
amp=/list
sender_name=Man Jackson
message=This
#39=
s a test=

There is also an issue with the examine text of mechcomp buttons re-encoding the already encoded signal.

This fix is the absolute bare minimum required to solve the problem, adding html_decode() to any string about to be transmitted by the wifi component and removing an html_encode() from mechcomp/trigger/button/get_desc(). There are probably more thorough ways to go about fixing the underlying issues, like adminscrub() encoding stuff that it never decoded in the first place.

If the 3 in that first code tag looks funny, it's because it's a ȝ, putting a real 3 in there made the whole thing turn into an apostrophe even in the code tag which muddied the waters a bit.


RE: [Bug] Mechcomp signal HTML encoding/decoding - somepotato - 03-08-2016

If I get some time, I'll go through the components and fix all the awry sanitization.


RE: [Bug] Mechcomp signal HTML encoding/decoding - ZeWaka - 05-31-2017

rejected because i think somepotato went through this