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#escapeTags throws an exception when input contains section symbols #799

Closed
JRoy opened this issue Jul 25, 2022 · 3 comments · Fixed by #833
Closed

MiniMessage#escapeTags throws an exception when input contains section symbols #799

JRoy opened this issue Jul 25, 2022 · 3 comments · Fixed by #833
Assignees
Milestone

Comments

@JRoy
Copy link

JRoy commented Jul 25, 2022

i want to be able to take untrusted user input which may contain legacy section symbol color codes and sanitize and tags from them before converting the section symbols to tags (because vise versa would cause the converted tags to be escaped)

@MiniDigger
Copy link
Member

mmmmh, not sure why MiniMessage would care about any other format, especially unsupported legacy ones. there is no code in MiniMessage to convert legacy stuff either.
if you manually call the legacy serializer to convert legacy stuff, sanitizing that is on you, no?

basically, i don't understand the usecase, can you provide more context?

@JRoy
Copy link
Author

JRoy commented Jul 25, 2022

mmmmh, not sure why MiniMessage would care about any other format, especially unsupported legacy ones. there is no code in MiniMessage to convert legacy stuff either.
if you manually call the legacy serializer to convert legacy stuff, sanitizing that is on you, no?

basically, i don't understand the usecase, can you provide more context?

Take for example chat in Essentials. It has a format in the form of a translation string and multiple arguments that are passed to it: display name, prefix, chat message, etc. Because it has user supplied input, we have to sanitize it for tags but the chat message, display name, and prefix all may have section symbols in them. I understand they're not supported in the parser which is why I already wrote code to convert section symbols to minimessage but I obviously can't do that before I escape tags since that would lead to the converted message being escaped by eacapeTags

@kezz
Copy link
Member

kezz commented Jul 25, 2022

Sounds like you want to use an unparsed placeholder tag resolver?

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