Skip to content

fix: correct migration 377 regex escaping#804

Open
anonymoususer72041 wants to merge 1 commit into
opencats:masterfrom
anonymoususer72041:fix/migration-377-regex-escaping
Open

fix: correct migration 377 regex escaping#804
anonymoususer72041 wants to merge 1 commit into
opencats:masterfrom
anonymoususer72041:fix/migration-377-regex-escaping

Conversation

@anonymoususer72041

Copy link
Copy Markdown
Contributor

This PR fixes the escaping of the regular expression used in migration 377.

The affected code is stored as a PHP string and evaluated later, so the regex needs to be escaped for both the surrounding migration string and the evaluated PHP code. The previous escaping caused the evaluated regex to differ from the intended pattern.

The updated version preserves the intended match behavior while making the evaluated regex valid and reliable. It also keeps the replacement string quoted correctly so $2 is treated as the regex capture group replacement instead of a PHP variable.

@anonymoususer72041 anonymoususer72041 requested a review from RussH June 9, 2026 09:51
@anonymoususer72041

Copy link
Copy Markdown
Contributor Author

@lucquach I think this fix is the needed fix, isn't it?

@anonymoususer72041

Copy link
Copy Markdown
Contributor Author

@RussH please take a deeper look into this fix. I think this should solve a problem which was caused by this migration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant