New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chat sanitization refactor #17313
Comments
Is it really a good idea to move this to the client? If the client is hacked then they can bypass the sanitization from how I'm imagining this |
Originally it was intended to be used for stuff like correcting text speak. Since we want to use it for slurs now, it should have the ability to be server side, but having the option to make some of them client side could still be good because all the text speak stuff can be client side and it'll prevent the server from having to match the messages. |
The steps I take when searching logs for slurs and other unacceptable words/sentences are as follow
|
For #24680: I'm religiously avoiding any form of regex for the chat sanitization work for two reasons:
|
@FairlySadPanda The number of people who understand something is always far smaller than the number of people capable of copy/pasting it off of stack overflow. I think having basic text matching and highly encouraging people to use that over regex is fine, but I also think regex needs to be supported to enable filtering that isn't possible with basic text matching. I don't think I'm familiar with any sort of half decent chat/text filtering system that doesn't support regex. In case it's unclear, I'm not saying that the filtering system should be based on regex substitutions, just that matching with regex should be supported |
OK: I think the best compromise here is allow regex expressions to be specified as a filter step, but having a robust (ahem) filtration system otherwise. Regex is just one of those things that tends to creep in as an innocent change. See also SQL 😉 |
Ya, the way I imagine it being used is as a condition for filtering When something like |
I've closed #24680 and will put a PR in for specifically text filtration that'll have regex as a specific option |
This issue has had some scope/intention changes since it was created. Please ping me on discord to talk to me about what admins want/need from it if you're interested in working on it. It's still mostly the same but I'd like to make sure that the intended use cases are going to be covered.
Description
The entire system could use a refactor to work with regex and have prototypes or something define the replacements instead of hardcoding them. It probably can/should also be client side instead of server side. If the client does sanitization before sending each message, the server doesn't have to worry about running sanitizations on each message.
Sanitization should be able to match based on any combination of:
Ideally, it'd support negative matches, (example: not a whisper) but that isn't super important. There should probably also be some way to order the substitution priority.
Sanitizations should be able to perform any combination of:
Examples
lol
Conditions:
\blol\b
Actions:
tbh
Conditions:
\btbh\b
Actions:
to be honest
tbh for people too afraid to replace it
Conditions:
\btbh\b
Actions:
Double spaces
Fixes double spaces caused by removals, should happen last
Conditions:
{2,}
Actions:
The text was updated successfully, but these errors were encountered: