-
-
Notifications
You must be signed in to change notification settings - Fork 373
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
<cmd:> with $ symbol in it doesn't work #2706
Comments
For reference, this doesn't work because it throws an exception:
Looks like Skript is trying to parse it as a regex, or something... Not sure how this should be handled exactly. |
👀 Definitely a bug, probably one that will not be fun to debug. |
Did someone forget to sanitize user input? |
The issue seems to be that for some reason it is trying to parse it as a regex in the first place |
@Wealthyturtle The StringUtils replaceAll method uses regex - I think the colour conversion in Skript is trying to use StringUtils#replaceAll to replace colour codes, but the replaceAll method fails to parse the string as regex (because the string wasn't sanitized before passing it to replaceAll) If this is the case, a solution would be to make sure the colour conversion sanitizes the string before passing it to replaceAll.. Then again, this suggests that there could be more problems with input sanitization hidden away in Njol's code... Edit: Was able to trigger this with Maybe Njol did sanitize input, but |
Good investigation! Maybe we shouldn't be using regex in the formatted/coloured expression in the first place since it adds some overhead. I mean, we could just iterate through the String once and check if the next character is 0-9 or a-f or k-o to determine if they should be deformatted or whatever. |
From #3002: This issue also seems to occur in |
Description
cmd: with $ in it, does not work.
Steps to Reproduce
Expected Behavior
to just work, now it sends absolutely nothing on that, I have a command with $ symbol in it.
(It used to work right before, I updated from 2.2 dev36 to 2.4)
Errors / Screenshots
None
Server Information
Additional Context
The text was updated successfully, but these errors were encountered: