Ensure filters/attributes aren't mistaken for operators#4774
Merged
fabpot merged 1 commit intotwigphp:3.xfrom Feb 24, 2026
Merged
Conversation
60437a3 to
a9ac993
Compare
Contributor
|
Thank you @brandonkelly. |
fabpot
added a commit
that referenced
this pull request
Feb 25, 2026
… separate operator token registration from parser identity (fabpot) This PR was merged into the 3.x branch. Discussion ---------- Add getOperatorTokens() to ExpressionParserInterface to separate operator token registration from parser identity Closes #4767 Closes #4774 Commits ------- e5eb95d Add getOperatorTokens() to ExpressionParserInterface to separate operator token registration from parser identity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates the regex in
Lexer::getOperatorRegex()to account for filters/attributes that have a space between their|/.operator and the filter/attribute name, to ensure they aren’t mistaken for operators.A test is included that checks the following template.
{{ 'foo'|and }} {{ 'bar' | and }} {{ foo.and }} {{ bar . and }} {{ foo and bar }}(Only the
andin the last tag should be considered an operator.)Fixes #4767