Skip to content
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

Name Regex filter enhancements #9917

Draft
wants to merge 2 commits into
base: content
Choose a base branch
from

Conversation

dreamscached
Copy link
Member

First of all, this is aimed at hardening the filter against workarounds such as doing m o m m y sort of trick by adding spaces; this is mitigated by completely stripping all non-alphanumeric characters and performing match against the result string.

Moreover, I also plan on modifying existing expressions so that they also account for 1337speak (e.g. replacing o with 0 and alike).

In addition to that (though, probably it's better to make it a separate PR) I want to try to exclude possible false positives.

@Booplicate
Copy link
Member

I'm fixing the known false-positives, but if you do that before me, that's fine.

@@ -516,6 +516,7 @@ label mas_player_name_enter_name_loop(input_prompt):
).strip(' \t\n\r')

lowername = tempname.lower()
alphaname = re.sub("[^a-zA-Z0-9]", "", tempname)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest using \s as that should catch any kind of space while allowing every other symbol (think about translations that might allow different characters, or maybe if we get proper unicode support in the future).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants