* 3.x:
Bump actions/cache for CI
Remove an obsolete comment
Throws proper Twig exception when using cycle on an empty array
Add tests when a template doesn't have output nodes
Optimize TextNodes
Remove list() usage in code
Remove usage of list() in favor of []
This PR was merged into the 3.x branch.
Discussion
----------
Throws proper Twig exception when using cycle on an empty array
Closes#3925
Commits
-------
d21666f7 Throws proper Twig exception when using cycle on an empty array
This PR was merged into the 3.x branch.
Discussion
----------
Optimize TextNodes
Not a great perf optimization, but it makes the node graph simpler which helps when we need to debug templates.
Commits
-------
c44bd1ff Optimize TextNodes
It is not obvious that you cannot use the Twig function `constant` to get the special `::class` constants of classes like so: `{{ constant('Twig\\Extension\\CoreExtension::class') }}`, due to the underlying PHP function `\constant()`.
The previous error message in this case: 'Constant "Twig\Extension\CoreExtension::class" is undefined.' was not very helpful.
This PR was squashed before being merged into the 2.x branch.
Discussion
----------
Add SourcePolicyInterface to selectively enable the Sandbox based on a template's Source
This is needed to patch some downstream vulnerabilities which I won't describe here.
I wrote `@fabpot` an email about this with more details a few weeks ago.
Generally the Sandbox can be enabled for a given template in either of two ways:
* Globally
* Including the template from another template in which we use the sandbox tag or parameter
This pull request adds a third way
* Using a SourcePolicy to selectively sandbox templates based on their Source object
Commits
-------
a18da161 Add SourcePolicyInterface to selectively enable the Sandbox based on a template's Source
* 3.x:
Fix CS
Move functions for CoreExtension
Move functions for EscaperExtension
Move functions for StringLoaderExtension
Move functions for DebugExtension
Move functions for MarkdownExtension
Move functions for InkyExtension
Move functions for CssInlinerExtension
Move functions for HtmlExtension
Deprecate internal extension functions in favor of methods on the extension classes
Tweak deprecated docs