Commit Graph

6227 Commits

Author SHA1 Message Date
Fabien Potencier d1824b237b Fix bug 2023-12-20 20:50:18 +01:00
Fabien Potencier 3d849eab57 Merge branch '3.x' into 4.x
* 3.x:
  Simplify code
2023-12-20 20:48:01 +01:00
Fabien Potencier 7072a7256e bug #3949 Simplify code when using ob_* functions (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Simplify code when using `ob_*` functions

And fixed an edge case (see the modified test).

Commits
-------

0b9e30e3 Simplify code
2023-12-20 20:46:37 +01:00
Fabien Potencier 0b9e30e3d2 Simplify code 2023-12-20 20:43:49 +01:00
Fabien Potencier 87953c0d08 Merge branch '3.x' into 4.x
* 3.x:
  Fix bad merge
  Fix test without any assertions
  Simplify tests
2023-12-20 20:37:25 +01:00
Fabien Potencier 83dfc0f823 bug #3948 Simplify sandbox tests (fabpot)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Simplify sandbox tests

This allows to remove some unneeded assertions and fix static analysis checks.

Commits
-------

bc22e38c Fix bad merge
e6a98a00 Fix test without any assertions
fca89954 Simplify tests
2023-12-20 20:37:13 +01:00
Fabien Potencier bc22e38ce6 Fix bad merge 2023-12-20 20:34:40 +01:00
Fabien Potencier e6a98a000f Fix test without any assertions 2023-12-20 20:34:04 +01:00
Fabien Potencier fca89954f1 Simplify tests 2023-12-20 20:34:04 +01:00
Fabien Potencier d27c50850d Merge branch '3.x' into 4.x
* 3.x:
  Add SourcePolicyInterface to selectively enable the Sandbox based on a template's Source
  add docs & links
2023-12-19 08:20:44 +01:00
Fabien Potencier 204cd6f412 Merge branch '2.x' into 3.x
* 2.x:
  Add SourcePolicyInterface to selectively enable the Sandbox based on a template's Source
2023-12-19 08:19:15 +01:00
Fabien Potencier a4974b29a0 feature #3893 Add SourcePolicyInterface to selectively enable the Sandbox based on a template's Source (YSaxon)
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
2023-12-19 08:18:38 +01:00
Yaakov Saxon a18da1614a Add SourcePolicyInterface to selectively enable the Sandbox based on a template's Source 2023-12-19 08:18:35 +01:00
Fabien Potencier e8c511ebc4 minor #3944 Add type hints to private properties (fabpot)
This PR was merged into the 4.x branch.

Discussion
----------

Add type hints to private properties

Commits
-------

35640b6d Add type hints to private properties
2023-12-14 20:45:59 +01:00
Fabien Potencier 35640b6d2d Add type hints to private properties 2023-12-14 20:43:37 +01:00
Fabien Potencier d2f493f67c minor #3941 add docs & links (lacpandore)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

add docs & links

Commits
-------

dd24d5bf add docs & links
2023-12-14 08:17:08 +01:00
Louis-Arnaud dd24d5bfd2 add docs & links 2023-12-14 08:17:06 +01:00
Fabien Potencier ffa55e8cae minor #3942 Use DateTimeImmutable (fabpot)
This PR was merged into the 4.x branch.

Discussion
----------

Use DateTimeImmutable

Commits
-------

b3e8b8ac Use DateTimeImmutable
2023-12-13 12:55:07 +01:00
Fabien Potencier b3e8b8ac39 Use DateTimeImmutable 2023-12-12 22:53:10 +01:00
Fabien Potencier 1493fdfb19 Remove deprecated method 2023-12-11 13:46:08 +01:00
Fabien Potencier 325ef1355e minor #3937 Remove deprecated code (fabpot)
This PR was merged into the 4.x branch.

Discussion
----------

Remove deprecated code

Commits
-------

f84c2172 Remove deprecated code
2023-12-10 21:04:17 +01:00
Fabien Potencier f84c2172bf Remove deprecated code 2023-12-10 21:02:11 +01:00
Fabien Potencier ac423430aa Merge branch '3.x' into 4.x
* 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
2023-12-10 20:55:15 +01:00
Fabien Potencier 804cb1b85b feature #3883 Deprecate internal extension functions in favor of methods on the extension classes (fabpot)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Deprecate internal extension functions in favor of methods on the extension classes

~~PoC on a simple extension for now.~~

Commits
-------

aa7c454e Fix CS
54d34b96 Move functions for CoreExtension
72071e8e Move functions for EscaperExtension
196e91dd Move functions for StringLoaderExtension
d4d01603 Move functions for DebugExtension
69a89e0e Move functions for MarkdownExtension
e07e9b5b Move functions for InkyExtension
bff189f1 Move functions for CssInlinerExtension
6a18cda5 Move functions for HtmlExtension
16abb69d Deprecate internal extension functions in favor of methods on the extension classes
2023-12-10 20:42:55 +01:00
Fabien Potencier aa7c454e2d Fix CS 2023-12-10 20:34:32 +01:00
Fabien Potencier 54d34b969b Move functions for CoreExtension 2023-12-10 20:13:10 +01:00
Fabien Potencier 72071e8ece Move functions for EscaperExtension 2023-12-10 11:49:57 +01:00
Fabien Potencier 196e91dd72 Move functions for StringLoaderExtension 2023-12-10 11:38:36 +01:00
Fabien Potencier d4d016034c Move functions for DebugExtension 2023-12-10 11:35:00 +01:00
Fabien Potencier 69a89e0e77 Move functions for MarkdownExtension 2023-12-09 18:39:03 +01:00
Fabien Potencier e07e9b5be3 Move functions for InkyExtension 2023-12-09 18:39:03 +01:00
Fabien Potencier bff189f19a Move functions for CssInlinerExtension 2023-12-09 18:39:03 +01:00
Fabien Potencier 6a18cda5aa Move functions for HtmlExtension 2023-12-09 18:39:01 +01:00
Fabien Potencier 16abb69d12 Deprecate internal extension functions in favor of methods on the extension classes 2023-12-09 18:11:17 +01:00
Fabien Potencier d602a55603 Tweak deprecated docs 2023-12-09 17:48:07 +01:00
Fabien Potencier 7e48b0aa83 minor #3936 Remove usage of isset before array_key_exists as performance is not an issue anymore (fabpot)
This PR was merged into the 4.x branch.

Discussion
----------

Remove usage of isset before array_key_exists as performance is not an issue anymore

Commits
-------

c8d6df7e Remove usage of isset before array_key_exists as performance is not an issue anymore
2023-12-09 17:25:54 +01:00
Fabien Potencier c8d6df7eb2 Remove usage of isset before array_key_exists as performance is not an issue anymore 2023-12-09 17:24:12 +01:00
Fabien Potencier a2eb71ce66 minor #3935 Simplify generated code by using named arguments (fabpot)
This PR was squashed before being merged into the 4.x branch.

Discussion
----------

Simplify generated code by using named arguments

Commits
-------

bce22e4c Use named arguments
a64561b4 Simplify code
2023-12-09 17:22:30 +01:00
Fabien Potencier bce22e4c32 Use named arguments 2023-12-09 17:18:55 +01:00
Fabien Potencier a64561b420 Simplify code 2023-12-09 17:18:14 +01:00
Fabien Potencier aa4b59c0ed minor #3934 Use PHP 8 features (fabpot)
This PR was squashed before being merged into the 4.x branch.

Discussion
----------

Use PHP 8 features

Commits
-------

be67e969 Use str_* when possible
0668be9e Use arrow function
06d9fc6a Use is_countable()
89d37cd5 Use get_debug_type()
308aa5ba Remove usage of list()
a42eba63 Use match instead of switch
fed8dd10 Use ::class
2023-12-09 17:14:40 +01:00
Fabien Potencier be67e9690f Use str_* when possible 2023-12-09 15:33:38 +01:00
Fabien Potencier 0668be9e76 Use arrow function 2023-12-09 15:33:38 +01:00
Fabien Potencier 06d9fc6ad0 Use is_countable() 2023-12-09 15:33:38 +01:00
Fabien Potencier 89d37cd510 Use get_debug_type() 2023-12-09 15:33:38 +01:00
Fabien Potencier 308aa5ba45 Remove usage of list() 2023-12-09 15:33:38 +01:00
Fabien Potencier a42eba63c5 Use match instead of switch 2023-12-09 15:33:38 +01:00
Fabien Potencier fed8dd102b Use ::class 2023-12-09 15:33:38 +01:00
Fabien Potencier 67c8798074 minor #3933 Remove obsolete code (fabpot)
This PR was squashed before being merged into the 4.x branch.

Discussion
----------

Remove obsolete code

Commits
-------

b9cf29d5 Remove obsolete code
583d7b2d Remove hack to inline throwing an exception
3d5ad9ac Remove obsolete code
3472ae12 Simplify code
2023-12-09 14:58:14 +01:00
Fabien Potencier b9cf29d53d Remove obsolete code 2023-12-09 14:56:21 +01:00