KyoriPowered / adventure

A user-interface library, formerly known as text, for Minecraft: Java Edition
https://docs.advntr.dev/
MIT License
706 stars 107 forks source link

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

Closed rymiel closed 9 months ago

rymiel commented 9 months ago

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 https://github.com/KyoriPowered/adventure/issues/1011

zml2008 commented 9 months ago

thank you <3