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

Phobia regex should not be a global expression #5008

Conversation

LikeLakers2
Copy link
Contributor

@LikeLakers2 LikeLakers2 commented Jan 21, 2025

About The Pull Request

While developing a new quirk that used the phobia system, I noticed that I was able to bypass the phobia regex.

Looking further into it, I found that the phobia regex is marked as a global expression with the g. Quoting the DM Reference on the g flag:

Global: In Find() subsequent calls will start where this left off, and in Replace() all matches are replaced.

This clearly isn't the behavior we want for handling text in phobias! Thus, this PR removes the g flag from phobia regexes.

Why It's Good For The Game

Bug fixes give me good coder points. :D

Changelog

🆑MichiRecRoom
fix: Word phobias should always apply now, rather than occasionally being missed.
/:cl:

@Absolucy
Copy link
Member

I do wonder if these could use acreplace instead of a regex entirely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix fix da bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants