space-wizards / space-station-14

A multiplayer game about paranoia and chaos on a space station. Remake of the cult-classic Space Station 13.
https://spacestation14.io
MIT License
2.69k stars 3.37k forks source link

Chat sanitization doesn't work unless the target text is at the end of the message #17312

Open Chief-Engineer opened 1 year ago

Chief-Engineer commented 1 year ago

Description

"Test lol" will be correctly sanitized, but "lol test" or "test lol test" will not.

VasilisThePikachu commented 1 year ago

Is this a dupe of #14748 ? if yes then its intended apparently

Chief-Engineer commented 1 year ago

Is this a dupe of #14748 ? if yes then its intended apparently

It is a dupe of that issue, but I don't see why this behavior would be intended. I can imagine why you wouldn't want to remove certain text patterns from the middle of sentences, but I can't imagine why you wouldn't want to replace something like a :) at the start of a sentence with a smile emote. It'd probably be safe to replace any smile that doesn't include letters, regardless of where it is in a sentence, as long as it has spaces, punctuation, or the start/end of the message on both sides of it