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

Fix EffReplace escaping characters when not needed #4110

Merged

Conversation

TPGamesNL
Copy link
Member

@TPGamesNL TPGamesNL commented Jun 24, 2021

Description

Update EffReplace and StringUtils so it only escapes the replacement string if needed, which is only if the replacement is done with regex, which is only done if case sensitivity is disabled.


Target Minecraft Versions: any
Requirements: none
Related Issues: #1226

@TPGamesNL TPGamesNL added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Jun 24, 2021
@TPGamesNL TPGamesNL changed the title Update files Fix EffReplace escaping characters when not needed Jun 24, 2021
Copy link
Member

@APickledWalrus APickledWalrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Wouldn't this only happen if case sensitivity is disabled though, or am I missing something? Also, does this change need done for the replaceFirst method too (it uses regex too iirc)?

@TPGamesNL
Copy link
Member Author

Oh yea I mistyped that, my bad. StringUtils.replaceFirst doesn't need this, since both of those are regex, not just the non-case sensitive one, and EffReplace does the escaping already.

@APickledWalrus APickledWalrus merged commit 83e9dbc into SkriptLang:master Jun 24, 2021
@TPGamesNL TPGamesNL deleted the fix/eff-replace-escaping-issues branch June 25, 2021 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants