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

minimessage: Fix exception with single quote as tag part #1012

Merged
merged 1 commit into from Dec 19, 2023

Conversation

rymiel
Copy link
Member

@rymiel rymiel commented Dec 19, 2023

The parser tries to un-quote tag parts surrounded by quotes, it does so by checking if the first character of the tag part is a quote and the last character is as well. However, things break if that first and last character are actually the same character! A StringIndexOutOfBoundsException is thrown later on.

This patch makes it so tag parts consisting of a single quote aren't tried to be un-quoted, they stay as is

Fixes #1011

The parser tries to un-quote tag parts surrounded by quotes, it does so
by checking if the first character of the tag part is a quote and the
last character is as well. However, things break if that first and last
character are actually the same character! A
StringIndexOutOfBoundsException is thrown later on.

This patch makes it so tag parts consisting of a single quote aren't
tried to be un-quoted, they stay as is

Fixes #1011
@zml2008
Copy link
Member

zml2008 commented Dec 19, 2023

thank you <3

@rymiel rymiel added this pull request to the merge queue Dec 19, 2023
Merged via the queue into main/4 with commit 87fc5dc Dec 19, 2023
5 checks passed
@rymiel rymiel deleted the fix/mm-single-quote branch December 19, 2023 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants