Skip to content

Report regular expression errors from the matches operator - #4909

Merged
fabpot merged 1 commit into
twigphp:3.xfrom
fabpot:harden-matches-pcre-errors
Aug 28, 2026
Merged

Report regular expression errors from the matches operator#4909
fabpot merged 1 commit into
twigphp:3.xfrom
fabpot:harden-matches-pcre-errors

Conversation

@fabpot

@fabpot fabpot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

The matches operator now throws a RuntimeError when PCRE cannot evaluate a regular expression instead of silently treating the error as a non-match.

This makes failures such as exhausted backtrack limits visible to template authors.

@fabpot
fabpot merged commit 1d081e2 into twigphp:3.x Aug 28, 2026
52 of 53 checks passed
@fabpot
fabpot deleted the harden-matches-pcre-errors branch August 28, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants