Properly sanitizes loaded messages in tgui chat #56001
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
About The Pull Request
Properly sanitizes old messages in tgui chat, admins are now unable to make your chat toontown forever, only until you reload the window. The current implementation operates on a blacklist in conjunction with the
Oh also I added the
<u>
tag to the default sanitization list, and sorted it by name to remove duplicates.DOMPurify has an internal whitelist that it preserves, the current blacklist is made to cut out the items we don't want out of that list, and preserve behavior in case the package updates the whitelist in future. If I'm missing any tags please let me know, see the whitelist for our version of the package here
I've noticed some hitching in testing, but I'm not sure if that's just my pc acting up or what. I'm honestly not sure what's causing it as the function I'm modifying here,
loadChatFromStorage
should only ever be called once on init. Might be worth a testmerge.Why It's Good For The Game
Changelog
馃啈
admin: Chat messages that are more then text, so videos, embedded games, font changes, etc now get wiped when the chat is reloaded. NO MORE INFINITE WINGDINGS!
/:cl: