Commit Graph

6481 Commits

Author SHA1 Message Date
Fabien Potencier 41103dcdc2 Fix a security issue when an included sandboxed template has been loaded before without the sandbox context 2024-09-10 12:40:14 +02:00
Fabien Potencier e80fb8ebba Prepare the 3.11.0 release v3.11.0 2024-08-08 18:15:16 +02:00
Fabien Potencier fe32121084 Update CHANGELOG 2024-08-08 18:03:04 +02:00
Fabien Potencier 0d524d3ae7 feature #4182 Add the possibility to deprecate attributes and nodes on Node (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Add the possibility to deprecate attributes and nodes on Node

Commits
-------

18894cf9 Add the possibility to deprecate attributes and nodes on Node
2024-08-08 14:48:26 +02:00
Fabien Potencier 18894cf91e Add the possibility to deprecate attributes and nodes on Node 2024-08-08 14:48:20 +02:00
Fabien Potencier 90fbb9acbc feature #4183 Add support for package/version on deprecations (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Add support for package/version on deprecations

Commits
-------

0ce79df5 Use trigger_deprecation() instead of trigger_error() for deprecations
2024-08-08 14:46:03 +02:00
Fabien Potencier 0ce79df5c4 Use trigger_deprecation() instead of trigger_error() for deprecations 2024-08-08 14:28:28 +02:00
Fabien Potencier 839da16d04 Tweak docs 2024-08-08 11:12:39 +02:00
Fabien Potencier 92525785d8 minor #4181 clarify that macros shadow other macros/functions (xabbuh)
This PR was merged into the 3.x branch.

Discussion
----------

clarify that macros shadow other macros/functions

see https://github.com/twigphp/Twig/pull/4175#issuecomment-2273646498

Commits
-------

e1a94481 clarify that macros shadow other macros/functions
2024-08-08 10:53:25 +02:00
Christian Flothmann e1a9448190 clarify that macros shadow other macros/functions 2024-08-08 09:25:31 +02:00
Fabien Potencier 390c5a0b05 Remove debug info 2024-08-07 22:59:17 +02:00
Fabien Potencier 64d5b565d7 feature #4179 Move static attributes for Function|Filter|TestExpression to the constructor (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Move static attributes for Function|Filter|TestExpression to the constructor

Commits
-------

e8141bbd Move static attributes for Function|Filter|TestExpression to the constructor
2024-08-07 22:38:05 +02:00
Fabien Potencier e8141bbd34 Move static attributes for Function|Filter|TestExpression to the constructor 2024-08-07 22:29:43 +02:00
Fabien Potencier 15854ca9bf feature #4178 Constant expr as final (fabpot)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Constant expr as final

Closes #4119

Commits
-------

230e31d3 Add a recipe about how to mark a node as safe
693693ba Mark ConstantExpression as `@final`
2024-08-07 21:01:58 +02:00
Fabien Potencier 230e31d384 Add a recipe about how to mark a node as safe 2024-08-07 21:01:18 +02:00
Fabien Potencier f5e10e10f1 Fix CS 2024-08-07 19:34:09 +02:00
Fabien Potencier 693693ba3a Mark ConstantExpression as @final 2024-08-07 19:00:30 +02:00
Fabien Potencier ea4d706da1 feature #4171 Introduce ChainCache and ReadOnlyFilesystemCache (Okhoshi)
This PR was merged into the 3.x branch.

Discussion
----------

Introduce ChainCache and ReadOnlyFilesystemCache

Following the feedback in symfony/symfony#54384, I’m proposing the two new Cache implementations in Twig directly.

Commits
-------

0dbe1d9f Introduce ChainCache and ReadOnlyFilesystemCache
2024-08-07 14:41:36 +02:00
Quentin D. 0dbe1d9f6d Introduce ChainCache and ReadOnlyFilesystemCache
Signed-off-by: Quentin Devos <4972091+Okhoshi@users.noreply.github.com>
2024-08-07 14:31:56 +02:00
Fabien Potencier 6566066fab minor #4175 Add a note about how macros can override existing functions (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Add a note about how macros can override existing functions

Commits
-------

cea17143 Add a note about how macros can override existing functions
2024-08-07 11:26:22 +02:00
Fabien Potencier cea1714331 Add a note about how macros can override existing functions 2024-08-07 11:25:44 +02:00
Fabien Potencier 26b1dc590c minor #4170 Fix dumping callables on Node::__toString() (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix dumping callables on Node::__toString()

Closes #3694

Commits
-------

fc644721 Fix dumping callables on Node::__toString()
2024-08-04 16:38:14 +02:00
Fabien Potencier fc64472145 Fix dumping callables on Node::__toString() 2024-08-04 16:35:01 +02:00
Fabien Potencier fa3c341725 feature #3963 Add new "find" filter (smnandre)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Add new "find" filter

This filter returns the first _value_ matching the given arrow function or null

Attempt to solve #3962

(open to any feedback)

Commits
-------

4e262511 Add new "find" filter
2024-08-04 13:39:13 +02:00
Simon André 4e26251193 Add new "find" filter 2024-08-04 13:39:10 +02:00
Fabien Potencier 205ea9e300 minor #4164 Remove the templateClassPrefix property on Environment (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Remove the templateClassPrefix property on Environment

Commits
-------

215f9880 Remove the templateClassPrefix property on Environment
2024-07-31 22:48:26 +02:00
Fabien Potencier 0d09230b4b minor #4167 Fix various phpstan errors (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix various phpstan errors

Commits
-------

ae4f2840 Fix various phpstan errors
2024-07-31 09:30:45 +02:00
Fabien Potencier ae4f284043 Fix various phpstan errors 2024-07-30 11:17:22 +02:00
Fabien Potencier b566513ef1 minor #4166 [Tests] Fix EscaperRuntime namespace (smnandre)
This PR was merged into the 3.x branch.

Discussion
----------

[Tests] Fix EscaperRuntime namespace

From `Twig\Tests` to `Twig\Tests\Runtime`

Commits
-------

df4e66f4 Fix EscaperRuntime namespace
2024-07-30 09:30:10 +02:00
Simon André df4e66f420 Fix EscaperRuntime namespace
From `Twig\Tests` to `Twig\Tests\Runtime`
2024-07-30 00:36:02 +02:00
Fabien Potencier 215f9880f1 Remove the templateClassPrefix property on Environment 2024-07-28 16:25:21 +02:00
Fabien Potencier ae04075ed1 minor #4163 Use RawFilter in cache extra (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Use RawFilter in cache extra

Commits
-------

8e72c84c Use RawFilter in cache extra
2024-07-28 11:16:28 +02:00
Fabien Potencier 8e72c84c63 Use RawFilter in cache extra 2024-07-28 11:12:39 +02:00
Fabien Potencier 76becd4246 minor #4162 Simplify usage of RawFilter (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Simplify usage of RawFilter

Commits
-------

6e55b5f9 Simplify usage of RawFilter
2024-07-28 11:11:17 +02:00
Fabien Potencier 6e55b5f956 Simplify usage of RawFilter 2024-07-28 11:10:04 +02:00
Fabien Potencier 67c7967de2 bug #4161 Fix raw filter compat (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix raw filter compat

Commits
-------

a1789129 Fix raw filter compat
2024-07-28 10:57:43 +02:00
Fabien Potencier a17891292c Fix raw filter compat 2024-07-28 10:51:52 +02:00
Fabien Potencier de7767814b Remove deprecate feature in docs 2024-07-28 10:14:39 +02:00
Fabien Potencier 05475bf843 minor #4157 Remove magic handling of the raw filter (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Remove magic handling of the raw filter

Commits
-------

84b1b3e0 Remove magic handling of the raw filter
2024-07-28 10:10:22 +02:00
Fabien Potencier 84b1b3e0b3 Remove magic handling of the raw filter 2024-07-27 20:37:22 +02:00
Fabien Potencier 71021834cc bug #4156 Fix optimizer mode validation in OptimizerNodeVisitor (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix optimizer mode validation in OptimizerNodeVisitor

Commits
-------

0e6d717f Fix optimizer mode validation in OptimizerNodeVisitor
2024-07-27 20:27:56 +02:00
Fabien Potencier 0e6d717f2d Fix optimizer mode validation in OptimizerNodeVisitor 2024-07-27 20:27:31 +02:00
Fabien Potencier 1920e284a9 feature #4155 Add support for yielding from a generator in PrintNode (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Add support for yielding from a generator in PrintNode

Commits
-------

27f6171f Add support for yielding from a generator in PrintNode
2024-07-27 17:01:03 +02:00
Fabien Potencier 27f6171f2f Add support for yielding from a generator in PrintNode 2024-07-27 16:57:14 +02:00
Fabien Potencier 3c52cd9814 feature #4148 Deprecate NameExpression internal methods (smnandre)
This PR was merged into the 3.x branch.

Discussion
----------

Deprecate NameExpression internal methods

Deprecate two methods from `Twig\Node\Expression\NameExpression`:
* `isSimple()`: did not find any usage in Twig (or even Symfony) repositories
* `isSpecial()`: inlined for better performance ($name is available in the method)

Commits
-------

3531f959 Deprecate NameExpression internal methods
2024-07-27 15:43:19 +02:00
Fabien Potencier af90f88802 minor #4154 [Doc] Fix code syntax in deprecated.rst (smnandre)
This PR was merged into the 3.x branch.

Discussion
----------

[Doc] Fix code syntax in deprecated.rst

Add missing backticks

https://twig.symfony.com/doc/3.x/deprecated.html#extensions

<img width="846" alt="Capture d’écran 2024-07-27 à 14 22 26" src="https://github.com/user-attachments/assets/4dfaa859-778e-4a34-86a9-acc2eb9eccb6">

Commits
-------

343fefae [Doc] Fix code syntax in deprecated.rst
2024-07-27 15:41:30 +02:00
Simon André 343fefae10 [Doc] Fix code syntax in deprecated.rst
Add missing backticks
2024-07-27 14:21:54 +02:00
Fabien Potencier 51e7e5c405 minor #4151 Refactor some tests (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Refactor some tests

Commits
-------

ebcd5034 Refactor some tests
2024-07-24 12:55:18 +02:00
Fabien Potencier ebcd5034ee Refactor some tests 2024-07-24 08:44:11 +02:00
Fabien Potencier a656293915 minor #4150 Replace template loader mocks by ArrayLoader (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Replace template loader mocks by ArrayLoader

Commits
-------

e4e95f5b Replace template loader mocks by ArrayLoader
2024-07-24 08:31:51 +02:00