Commit Graph

5534 Commits

Author SHA1 Message Date
Ca-Jou ed2cfbd6f0 update Blackfire documentation URL 2023-12-09 12:44:01 +01:00
Fabien Potencier ad637405a8 Prepare the 2.15.6 release v2.15.6 2023-11-21 18:34:48 +01:00
Fabien Potencier a41a0e7fa5 Update CHANGELOG 2023-11-21 18:34:15 +01:00
Fabien Potencier 02262dee80 bug #3873 Fix premature loop exit in Security Policy lookup of allowed methods/properties (YSaxon)
This PR was squashed before being merged into the 2.x branch.

Discussion
----------

Fix premature loop exit in Security Policy lookup of allowed methods/properties

The current security policy logic exits too soon when checking permissions for allowed classes and their methods/properties, causing false negatives in situations involving classes related by inheritance.

Consider the following configuration:

```
'methods' => [
  'App\BasicCollection' => ['sortAlphabetically'],
  'App\AdvancedCollection'=> ['sortByTimestamp'],
],
```
where `AdvancedCollection` is a subclass of `BasicCollection`, and `mylist` is an instance of `AdvancedCollection`

If you try to call `{{ mylist.sortByTimestamp() }}`, the current code will first match `mylist` against `App\BasicCollection`. Since `sortByTimestamp` is not an allowed method for `App\BasicCollection`, the code will exit the loop and incorrectly deny access. It will never get to checking `App\AdvancedCollection`.

Note that reordering classes in the config can't solve this issue. If you flipped the order, then it would fail for `{{ mylist.sortAlphabetically() }}` instead.

This pull request fixes the issue by only exiting the loop early when both the class and method/property match.

Commits
-------

5e1838db Fix premature loop exit in Security Policy lookup of allowed methods/properties
2023-10-26 17:37:16 -07:00
Yaakov Saxon 5e1838dbca Fix premature loop exit in Security Policy lookup of allowed methods/properties 2023-10-26 17:37:13 -07:00
Fabien Potencier b83a0446cf Set Twig 2 end of maintenance to December 2023 2023-09-15 07:23:59 +02:00
Fabien Potencier 974c866961 Remove Drupal tests 2023-09-11 17:40:51 +02:00
Fabien Potencier 4d800d7632 Bump CI actions 2023-09-11 13:19:11 +02:00
Fabien Potencier ef655c4d6e Reorganize some information 2023-08-02 10:55:33 +02:00
Fabien Potencier 93c664f4c9 minor #3868 Add Twig Language Server and Modern Twig extension to docs (kaermorchen)
This PR was submitted for the 3.x branch but it was merged into the 2.x branch instead.

Discussion
----------

Add `Twig Language Server` and `Modern Twig` extension to docs

Commits
-------

a949600c Add `Twig Language Server` and `Modern Twig` extension to docs
2023-08-02 10:53:44 +02:00
Stanislav Romanov a949600c4b Add Twig Language Server and Modern Twig extension to docs 2023-08-02 10:53:41 +02:00
Fabien Potencier b60ed3e085 minor #3865 Bump min deps (fabpot)
This PR was merged into the 2.x branch.

Discussion
----------

Bump min deps

Commits
-------

c12990f9 Bump min deps
2023-07-29 17:33:29 +02:00
Fabien Potencier c12990f9e7 Bump min deps 2023-07-29 13:31:08 +02:00
Fabien Potencier 244d5de454 Fix BC break 2023-07-29 13:21:11 +02:00
Fabien Potencier e3804ae8aa bug #3864 Bump PHP version used by Drupal tests (fabpot)
This PR was squashed before being merged into the 2.x branch.

Discussion
----------

Bump PHP version used by Drupal tests

Commits
-------

da38e858 Update Drupal version in tests
64543c3c Fix code
4c4f73ca Bump PHP version used by Drupal tests
2023-07-29 13:19:42 +02:00
Fabien Potencier da38e858e3 Update Drupal version in tests 2023-07-28 12:21:15 +02:00
Fabien Potencier 64543c3c49 Fix code 2023-07-28 12:18:03 +02:00
Fabien Potencier 4c4f73ca70 Bump PHP version used by Drupal tests 2023-07-28 11:59:50 +02:00
Fabien Potencier 91a42f7f22 minor #3863 add return type for Symfony 7 compatibility (xabbuh)
This PR was merged into the 2.x branch.

Discussion
----------

add return type for Symfony 7 compatibility

Commits
-------

fac08ec7 add return type for Symfony 7 compatibility
2023-07-28 11:54:15 +02:00
Christian Flothmann fac08ec7d3 add return type for Symfony 7 compatibility 2023-07-27 11:30:49 +02:00
Fabien Potencier 7f4f55575b minor #3849 Mention where named arguments are supported (mpdude)
This PR was merged into the 2.x branch.

Discussion
----------

Mention where named arguments are supported

This follows up on #929. I tend to forget this detail, so it confuses me over and over again.

Commits
-------

ef9d7855 Mention where named arguments are supported
2023-06-12 08:16:05 +02:00
Matthias Pigulla ef9d785518 Mention where named arguments are supported 2023-06-09 11:18:52 +00:00
Fabien Potencier 51ccbdc983 Bump version 2023-05-03 21:08:52 +02:00
Fabien Potencier fc02a6af3e Prepare the 2.15.5 release v2.15.5 2023-05-03 19:49:41 +02:00
Fabien Potencier 17bf0637d9 Update CHANGELOG 2023-05-03 19:49:13 +02:00
Fabien Potencier 72230e28d3 bug #3837 Making the Lexer initialize itself lazily, to avoid loading the extension set early (weaverryan)
This PR was submitted for the 3.x branch but it was merged into the 2.x branch instead.

Discussion
----------

Making the Lexer initialize itself lazily, to avoid loading the extension set early

Hi!

Over on Symfony UX, we are pushing Twig in some crazy, "unconventional" ways by overriding the lexer to add a new HTML-like syntax - e.g. `<twig:Alert type="success">` - https://github.com/symfony/ux/blob/2.x/src/TwigComponent/src/Twig/ComponentLexer.php

Normally, the internal `Lexer` is not instantiated until it's needed - i.e. when a template is rendered. However, when overriding the lexer, our `ComponentLexer` needs to be instantiated early and set onto the `Environment`. And since it needs to extend `Lexer`, `Lexer::__construct()` is called much earlier than normal. One line in the constructor - https://github.com/twigphp/Twig/blob/f5ee1b6815a28fbab6e6fbb8c48b7964f0d93dd4/src/Lexer.php#L108 - causes the "extension set" to be loaded inside `Environment`. Some applications rely on being able to set extra Twig extensions after `Environment` is created, but before a template is rendered and our custom lexer currently breaks that.

So, the suggestion is to make the work inside `__construct()` done later. Everything is private, so I believe this is safe.

Cheers!

Commits
-------

2f7e8680 Making the Lexer initialize itself lazily, to avoid loading the extension set early
2023-05-03 19:47:15 +02:00
Ryan Weaver 2f7e868017 Making the Lexer initialize itself lazily, to avoid loading the extension set early 2023-05-03 19:47:11 +02:00
Fabien Potencier 872646a70f Fix LICENSE year 2023-02-08 08:44:48 +01:00
Fabien Potencier 2e99376bae minor #3806 Minor: Fixing language (ThomasLandauer)
This PR was submitted for the 3.x branch but it was squashed and merged into the 2.x branch instead.

Discussion
----------

Minor: Fixing language

Commits
-------

f52b45d2 Minor: Fixing language
2023-02-02 13:22:52 +01:00
Thomas Landauer f52b45d226 Minor: Fixing language 2023-02-02 13:22:48 +01:00
Fabien Potencier eb8bde3c41 Bump LICENSE year 2023-01-01 09:42:51 +01:00
Fabien Potencier d573914760 Bump version 2022-12-27 13:27:28 +01:00
Fabien Potencier 3e059001d6 Prepare the 2.15.4 release v2.15.4 2022-12-27 13:26:20 +01:00
Fabien Potencier de55785d85 Update CHANGELOG 2022-12-27 13:19:32 +01:00
Fabien Potencier 7cbabe42e2 bug #3738 do not clean up whitespace text nodes inside if tags (xabbuh)
This PR was merged into the 2.x branch.

Discussion
----------

do not clean up whitespace text nodes inside if tags

Commits
-------

c8ec092c do not clean up whitespace text nodes inside if tags
2022-12-26 18:08:03 +01:00
Christian Flothmann c8ec092ceb do not clean up whitespace text nodes inside if tags 2022-12-26 18:04:52 +01:00
Fabien Potencier 6cd1473d65 Bump version of actions/cache 2022-12-26 17:29:08 +01:00
naveen 3b6a2a6910 chore: Included githubactions in the dependabot config
This should help with keeping the GitHub actions updated on new releases. This will also help with keeping it secure.

Dependabot helps in keeping the supply chain secure https://docs.github.com/en/code-security/dependabot

GitHub actions up to date https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot

https://github.com/ossf/scorecard/blob/main/docs/checks.md#dependency-update-tool
Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
2022-12-26 17:19:56 +01:00
Fabien Potencier 61f55998d2 Fix tests 2022-12-26 16:06:40 +01:00
Fabien Potencier 6c2bb9fc8d bug #3769 Updates CoreExtension::twig_constant to check for definition first to avoid hard crash (Alex Henderson-Roche)
This PR was merged into the 2.x branch.

Discussion
----------

Updates CoreExtension::twig_constant to check for definition first to avoid hard crash

The behaviour of PHP's constant() method has been updated after https://github.com/php/php-src/issues/9905 was accepted and fixed in PHP 8.1 (and previously changed post PHP 8.0) . This PR prevents a fatal error in the case a constant is supplied that doesn't actually exist.

Commits
-------

56b31224 Updates CoreExtension::twig_constant to check for definition first to avoid hard crash
2022-12-26 13:36:08 +01:00
Alex Henderson-Roche 56b31224bd Updates CoreExtension::twig_constant to check for definition first to avoid hard crash 2022-12-26 13:36:01 +01:00
Fabien Potencier dec30692ab Do more Github actions updates 2022-12-26 12:47:02 +01:00
Fabien Potencier e428a0b701 Use checkout actions v3 2022-12-26 12:43:42 +01:00
Fabien Potencier 7f9cad9972 Add PHP 8.2 to the tests 2022-12-26 12:43:08 +01:00
Fabien Potencier ef7a5ef2e3 Remove a test that was a regression test for the C extension 2022-12-26 12:42:02 +01:00
Fabien Potencier 6642c3a520 minor #3779 Cycle function: Add output to example code (kathi-at-datrycs)
This PR was submitted for the 3.x branch but it was merged into the 2.x branch instead.

Discussion
----------

Cycle function: Add output to example code

At first I couldn't grasp the concept of the cycle function, but after I saw the output in twigfiddle it was clear. I can imagine other readers having the same issue. Therefore I suggest to add the output to the example code.

Commits
-------

1e3b126c Add output
2022-12-15 11:46:20 +01:00
Katharina Luthe 1e3b126cf2 Add output 2022-12-15 11:46:17 +01:00
Fabien Potencier 2ae70b5b9c minor #3780 Add missing argument for the cycle function (stof)
This PR was merged into the 2.x branch.

Discussion
----------

Add missing argument for the cycle function

Commits
-------

883fb333 Add missing argument for the cycle function
2022-12-15 11:45:51 +01:00
Fabien Potencier c8cf74de25 minor #3781 Fix the drupal testing script (stof)
This PR was merged into the 2.x branch.

Discussion
----------

Fix the drupal testing script

Commits
-------

f3b8c012 Fix the drupal testing script
2022-12-15 11:45:00 +01:00
Christophe Coevoet f3b8c01262 Fix the drupal testing script 2022-12-15 11:35:27 +01:00