-
-
Notifications
You must be signed in to change notification settings - Fork 101
Fix Top-Helper message length exploit #649
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
Fix Top-Helper message length exploit #649
Conversation
One was able to farm Top-Helper message length points by adding invisible characters to help messages
...ation/src/main/java/org/togetherjava/tjbot/commands/tophelper/TopHelpersMessageListener.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you test it quickly? Just to make sure it really works as expected, thanks.
It works with the zero width joiner. Charachters like äöü for example were also excluded but because the discord is english this should not be an issue |
@Nxllpointer why are umlaute excluded with |
You could do |
im okay with what it is. im just confused why its not included. which yields me to thinking that there might be a bug in your code. let me check it on regex101.com quickly |
Maybe it's an issue with how java handles Unicode categories |
Btw, you should have used a |
Hm. I used a string because replaceAll does not accept a pattern. Is there an easy readable solution? |
replacement via pattern goes through the pattern, not from string. sth like anyways, lets concentrate on why u think that the code doesnt work for umlaute. please elaborate |
Maybe I also can't read a number. If it works for you it should also work for the bot |
If you want to I can change it to a pattern later |
ur not getting me. u claimed that it doesnt work for umlaute. why did u say that? did u try it out and it didnt work? do we have a bug in the code? |
When I tried it it didn't work. Maybe I just forgot to update the database viewer. You can test if it works. |
@Zabuzard oops I just realized that instead of counting the visible chars I counted the invisible ones... I will make a PR with the fix and using Pattern. |
|
PR should fix everything now. Sorry for this stupid mistake. |
Fixes #648
One was able to farm Top-Helper message length points by adding invisible characters to help messages