This PR was merged into the 3.x branch.
Discussion
----------
Clarify the security scope for untrusted templates
Commits
-------
222a7f3f9a Clarify the security scope for untrusted templates
* 3.x:
Reuse assignment targets parsed for the for tag
add shadowing example
Update for.rst
Fix IntlExtension ignoring explicit formats when a date formatter prototype is set
bump Twig version metadata
# Conflicts:
# CHANGELOG
# doc/tags/for.rst
# src/Environment.php
# src/TokenParser/ForTokenParser.php
This PR was merged into the 3.x branch.
Discussion
----------
Reuse assignment targets parsed for the for tag
`ForTokenParser` rebuilds the loop targets returned by `parseAssignmentExpression()` into new `AssignContextVariable` instances, copying only the name and line number. But the parsed targets are already `AssignContextVariable` nodes with exactly those values, so the rebuild is a no-op left over from older Twig versions where for-targets were parsed as general expressions and needed normalizing.
Reusing the parsed nodes directly removes dead code, and makes the parser more robust: any metadata attached to the targets during parsing (now or in the future) is preserved instead of being silently dropped.
Commits
-------
9408f2a3f1 Reuse assignment targets parsed for the for tag
This PR was merged into the 3.x branch.
Discussion
----------
Update for.rst
Add context and explanation about loop.parent.
Commits
-------
02382585e9 add shadowing example
7234d51ec8 Update for.rst
This PR was merged into the 4.x branch.
Discussion
----------
⚰️ Drop useless php comparisons
Commits
-------
f2e549a92b⚰️ Drop useless php comparisons
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Fix IntlExtension ignoring explicit formats when a date formatter prototype is set
Closes#3845
Commits
-------
083b6dcabe Fix IntlExtension ignoring explicit formats when a date formatter prototype is set
This PR was merged into the 3.x branch.
Discussion
----------
bump Twig version metadata
following #4852
Commits
-------
57905dab67 bump Twig version metadata
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
Document and test sandbox __call support
Related to #1950
Commits
-------
29b66fd916 Document sandbox handling of magic __call() methods
72da20aeb7 Add sandbox tests for methods routed through __call()
This PR was merged into the 3.x branch.
Discussion
----------
Disable the fabbot test-case return type check
See https://github.com/symfony-tools/fabbot/pull/18
Commits
-------
27a2dba4a7 Disable the fabbot test-case return type check
This PR was squashed before being merged into the 3.x branch.
Discussion
----------
[Intl] Add format_list filter using PHP 8.5's IntlListFormatter
Adds a new `format_list` Twig filter to IntlExtension that formats arrays using using PHP 8.5's IntlListFormatter
On PHP < 8.5, using the filter throws a RuntimeError explaining the dependency on IntlListFormatter (Checks if `class_exists` to allow polyfills).
CI workflow only covered up to PHP 8.4, so I extended it to also run PHPUnit against 8.5.
phpstan's PHP version also bumped to 8.5.
Commits
-------
163f1b6341 [Intl] Add format_list filter using PHP 8.5's IntlListFormatter
* 3.x:
Exempt test files from the void_return rule regardless of the config location
fix version in deprecation message for tag usage outside of root template
Fix array access with a Stringable key on ArrayAccess objects using object keys
Throw a SyntaxError instead of a PHP fatal error when a macro argument is defined twice
Bump version
Prepare the 3.28.0 release
Render backed enums using their backing value in the html_attr function
Tweak previous merge
Add documention note about variable scope of override blocks in {% embed ... only %}
Define the macro at the template root in the cache macro fixture
Update CHANGELOG
Fix a PHP 8.5 chr() deprecation when decoding octal string escapes
Fix Markup truthiness in boolean expressions
# Conflicts:
# CHANGELOG
# doc/deprecated.rst
# src/Environment.php
# src/Node/Expression/TempNameExpression.php
# src/Node/IfNode.php
# src/Node/MacroNode.php
# src/NodeVisitor/CorrectnessNodeVisitor.php
# tests/Fixtures/tags/inheritance/extends_in_condition.test
# tests/Fixtures/tags/inheritance/use_in_condition.test
# tests/Fixtures/tags/inheritance/use_in_macro.test
# tests/Fixtures/tags/macro/macro_in_block.test
# tests/Fixtures/tags/macro/macro_in_condition.test
This PR was merged into the 3.x branch.
Discussion
----------
Fix array access with a Stringable key on ArrayAccess objects using object keys
Closes#4855
Commits
-------
679b8fd610 Fix array access with a Stringable key on ArrayAccess objects using object keys
This PR was merged into the 3.x branch.
Discussion
----------
Fix version in deprecation message for tag usage outside of root template
#4292 has been introduced in 3.28 and related deprecations are shown for this version in changelog file
But in some part of code including deprecation message, it's about 3.27, this is confusing when upgrading Twig
Commits
-------
fc4dee393c fix version in deprecation message for tag usage outside of root template
This PR was merged into the 3.x branch.
Discussion
----------
Throw a SyntaxError instead of a PHP fatal error when a macro argument is defined twice
Commits
-------
0d283d304a Throw a SyntaxError instead of a PHP fatal error when a macro argument is defined twice