Draft
Conversation
Remove the redundant isPhpEnabled global and make isEvaluatingUserData the single trust gate, while forcing parseView to render in trusted mode and preserving state boundaries in site config parsing. Made-with: Cursor
Use a trusted parameter instead of php, carry it through parseLoop and endpoint facades, and ensure tag-rendered templates execute in trusted mode to preserve view-time behavior. Made-with: Cursor
Default parser test helpers to trusted mode for legacy runtime expectations and mark method/PHP execution assertions as trusted where they verify developer-template behavior. Made-with: Cursor
Derive trusted from the current user-content evaluation state instead of hardcoding trusted mode so nested tag parsing preserves caller safety context. Made-with: Cursor
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.
This PR improves the safety net of Antlers by defaulting to a stricter subset of features.
When parsing user content, you'd get reduced features such as php syntax being disabled.
These have been tightened further, for example only a subset of tags and modifiers may be used.
This PR changes Antlers::parse() to assume it's user data by default. You may opt into the trusted mode with a boolean.
The behavior of actual Antlers templates/views do not change and get the full behavior they previously did. No need to opt into any additional tags or modifiers.
This also reverts the Antlers::parseUserContent() method added in #14058.
This PR is a small breaking change for the sake of security.
If you're using antlers in content fields, and you are using tags or modifiers, you will need to opt into them via the
statamic.antlers.allowedContentTagsandallowedContentModifiers.