Commit Graph

6330 Commits

Author SHA1 Message Date
Fabien Potencier 16acdf69fe Rename some internal methods 2024-05-01 10:19:22 +02:00
Fabien Potencier c2c2058c33 feature #4055 Extract the escaping logic to a runtime (fabpot)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Extract the escaping logic to a runtime

Commits
-------

ead768a4 -
e4a78534 Add missing `@deprecated` tags
d728d1b8 Add more information about migrating away from twig_escape_filter()
70b2e3ca Fix compat with older versions of PHP
84bff064 Extract the escaping logic to a runtime
2024-05-01 09:13:27 +02:00
Fabien Potencier ead768a495 - 2024-05-01 09:11:02 +02:00
Fabien Potencier c133e2d962 bug #4062 Fix capturing output from extensions that still use echo (nicolas-grekas)
This PR was merged into the 3.x branch.

Discussion
----------

Fix capturing output from extensions that still use echo

Fix #4039

Commits
-------

8c43456a Fix capturing output from extensions that still use echo
2024-04-30 16:58:19 +02:00
Nicolas Grekas 8c43456ac6 Fix capturing output from extensions that still use echo 2024-04-30 16:48:10 +02:00
Fabien Potencier 82f8864e7b Fix a @return type hint 2024-04-30 15:38:55 +02:00
Fabien Potencier 7518f0b15c minor #4061 Fix a test (fabpot)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Fix a test

Commits
-------

fa714ce6 Fix CS
c2fc437f Fix a test
2024-04-30 15:32:11 +02:00
Fabien Potencier fa714ce6bd Fix CS 2024-04-30 15:30:51 +02:00
Fabien Potencier 70551da3c3 minor #4060 Simplify sandbox code (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Simplify sandbox code

Commits
-------

469d52d1 Simplify sandbox code
2024-04-30 15:27:30 +02:00
Fabien Potencier c2fc437f6a Fix a test 2024-04-30 15:23:35 +02:00
Fabien Potencier e142e3bf78 Fix type 2024-04-30 13:43:26 +02:00
Fabien Potencier 469d52d1b8 Simplify sandbox code 2024-04-30 13:40:56 +02:00
Fabien Potencier 775a445e37 minor #4059 Get rid of weird code (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Get rid of weird code

Commits
-------

83fe22ab Get rid of weird code
2024-04-30 13:10:17 +02:00
Fabien Potencier 83fe22ab15 Get rid of weird code 2024-04-30 12:37:10 +02:00
Fabien Potencier 68a826cf61 minor #3969 [html-extra] filter classes (kbond)
This PR was merged into the 3.x branch.

Discussion
----------

[html-extra] filter classes

A small formatting change to avoid double spaces:

```twig
class="{{ html_classes('a', false ? 'b', true ? 'c') }}"

{# before #}
class="a  c"

{# after #}
class="a c"
```

Commits
-------

a517c14f [html-extra] filter classes
2024-04-29 21:43:39 +02:00
Kevin Bond a517c14f19 [html-extra] filter classes 2024-04-29 21:42:05 +02:00
Fabien Potencier e4a78534ff Add missing @deprecated tags 2024-04-29 14:25:26 +02:00
Fabien Potencier d728d1b8a6 Add more information about migrating away from twig_escape_filter() 2024-04-29 08:30:49 +02:00
Fabien Potencier 70b2e3ca5d Fix compat with older versions of PHP 2024-04-28 21:26:07 +02:00
Fabien Potencier 84bff0643c Extract the escaping logic to a runtime 2024-04-28 21:26:07 +02:00
Fabien Potencier 1ee72a838f minor #4054 Fix some inconsistencies (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix some inconsistencies

Commits
-------

5148d105 Fix some inconsistencies
2024-04-28 13:16:42 +02:00
Fabien Potencier 5148d10515 Fix some inconsistencies 2024-04-28 13:15:26 +02:00
Fabien Potencier e8df2b7217 Tweak docs about operators 2024-04-28 10:58:29 +02:00
Fabien Potencier 8766c2cec7 minor #4004 [Doc] Correct Order & Explanation on precedence (lacpandore)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

[Doc] Correct Order & Explanation on precedence

Following this [issue](https://github.com/twigphp/Twig/issues/3714), i worked on it trying to make it simple and easy to understand

Indeed order of the precedence was not good for ``b-and``, ``b-xor`` and  ``b-and``.
Code [here ](https://github.com/twigphp/Twig/blob/3.x/src/Extension/CoreExtension.php#L280) to understand. I also added additional explanations.

Commits
-------

01e0b7ce [Doc] Correct Order & Explanation on precedence
2024-04-28 10:41:32 +02:00
lacpandore 01e0b7ce42 [Doc] Correct Order & Explanation on precedence 2024-04-28 10:41:28 +02:00
Fabien Potencier f67ad6c8a4 minor #4053 Respect coding standard in documentation (VincentLanglet)
This PR was merged into the 3.x branch.

Discussion
----------

Respect coding standard in documentation

From https://twig.symfony.com/doc/3.x/coding_standards.html

```
Put exactly one space after the : sign in hashes and , in arrays and hashes:
{{ [1, 2, 3] }}
{{ {'foo': 'bar'} }}
```

Commits
-------

609620e8 Respect coding standard in documentation
2024-04-27 22:01:37 +02:00
Vincent Langlet 609620e83e Respect coding standard in documentation 2024-04-27 21:31:11 +02:00
Fabien Potencier 57a9cdb8fd bug #4050 synchronize sourceContext (Lumaraf)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

synchronize sourceContext

I have some debugging extensions that need the template name from various nodes in a `NodeVisitor`. Currently this is guaranteed for the nodes created from parsing the template. This ensures that the `SourceContext` is also set for nodes created by `NodeVisitors` modifying the node tree.

I am not sure if it is a good idea to always set the `SourceContext` on a child node or if this should only set it if it is not set.

Commits
-------

350670a3 synchronize sourceContext
2024-04-27 10:45:44 +02:00
Daniel Penning 350670a321 synchronize sourceContext 2024-04-27 10:45:41 +02:00
Fabien Potencier 4a7de4ab56 Bump version to 3.9.4-DEV 2024-04-24 08:21:14 +02:00
Fabien Potencier 24b73b8f0f bug #4049 Fix a warning (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix a warning

Closes #4048

Commits
-------

ccc20cbd Fix a warning
2024-04-24 08:20:37 +02:00
Fabien Potencier ccc20cbd1b Fix a warning 2024-04-24 08:06:10 +02:00
Fabien Potencier 861c76cb00 minor #4043 Use ::class everywhere (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Use ::class everywhere

Commits
-------

a71ae192 Use ::class everywhere
2024-04-19 10:51:07 -04:00
Fabien Potencier a71ae1923e Use ::class everywhere 2024-04-19 10:26:00 -04:00
Nicolas Grekas 12625c0c05 minor #4042 Auto-close PRs on subtree-splits (kbond)
This PR was merged into the 3.x branch.

Discussion
----------

Auto-close PRs on subtree-splits

Same as https://github.com/symfony/symfony/pull/54653

Commits
-------

b212f1bb Auto-close PRs on subtree-splits
2024-04-19 08:34:32 +02:00
Kevin Bond b212f1bb2f Auto-close PRs on subtree-splits 2024-04-19 08:34:22 +02:00
Fabien Potencier ad934312cd Bump version 2024-04-18 08:00:19 -04:00
Fabien Potencier a842d75fed Prepare the 3.9.3 release v3.9.3 2024-04-18 07:59:33 -04:00
Fabien Potencier cb307d7fea Update CHANGELOG 2024-04-18 07:59:01 -04:00
Fabien Potencier 117b502411 bug #4037 fix: #4033 add missing unwrap call on TemplateWrapper instance (TLG-Gildas)
This PR was merged into the 3.x branch.

Discussion
----------

fix: #4033 add missing unwrap call on TemplateWrapper instance

Commits
-------

6c631526 fix: #4033 add missing unwrap call when a TemplateWrapper instance can be present
2024-04-18 07:51:18 -04:00
Fabien Potencier 89d6acfe31 bug #4038 Ensure Lexer:: is always initialized (danut007ro)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Ensure Lexer:: is always initialized

I'm using Symfony Bridge `LintCommand` with `--show-deprecations` flag.

While Twig is initializing, if an deprecation error is thrown by `Lexer::getOperatorRegex()` method, the `Lexer::$regexes` will remain `null` but `$isInitialized` will be set to TRUE.

This PR ensures that `$regexes` will be initialized.

Commits
-------

5a79652e Ensure Lexer:: is always initialized
2024-04-18 07:49:48 -04:00
Daniel Gorgan 5a79652e7c Ensure Lexer:: is always initialized 2024-04-18 07:49:46 -04:00
Fabien Potencier 15f596635d bug #4036 change extended DI extension class (xabbuh)
This PR was merged into the 3.x branch.

Discussion
----------

change extended DI extension class

Commits
-------

b61a4224 change extended DI extension class
2024-04-18 07:36:11 -04:00
Fabien Potencier be6dbbc102 bug #4035 fix: #4029 CaptureNode iterator_to_array preserveKeys false (TLG-Gildas)
This PR was merged into the 3.x branch.

Discussion
----------

fix: #4029 CaptureNode iterator_to_array preserveKeys false

Commits
-------

f7121a23 fix: #4029 when use_yield is true CaptureNode use iterator_to_array preserveKeys argument to false
2024-04-18 07:32:31 -04:00
Gildas de Cadoudal 6c6315263e fix: #4033 add missing unwrap call when a TemplateWrapper instance can be present 2024-04-18 11:47:39 +02:00
Christian Flothmann b61a422493 change extended DI extension class 2024-04-18 11:24:21 +02:00
Gildas de Cadoudal f7121a23bc fix: #4029 when use_yield is true CaptureNode use iterator_to_array preserveKeys argument to false 2024-04-18 09:45:09 +02:00
Fabien Potencier 7d2b814e6c bug #4032 Add twig_escape_filter_is_safe() as deprecated. (brummbar)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Add twig_escape_filter_is_safe() as deprecated.

Fix for #4031

Commits
-------

1170144f Add twig_escape_filter_is_safe() as deprecated.
2024-04-17 15:26:51 -04:00
Francesco Sardara 1170144f66 Add twig_escape_filter_is_safe() as deprecated. 2024-04-17 15:26:49 -04:00
Fabien Potencier c145871023 Bump version 2024-04-17 10:17:23 -04:00