Commit Graph

45 Commits

Author SHA1 Message Date
Fabien Potencier b762bc94b9 Make the sandbox a first-class citizen with a dedicated Sandbox class 2026-07-30 12:05:47 +02:00
Fabien Potencier 416d07da1d Add an allow-list for tests to the sandbox security policy 2026-06-06 11:08:56 +02:00
Fabien Potencier af7bf5e181 Add a strict mode to SecurityPolicy to opt-in to the 4.0 sandbox behavior for the extends/use tags and the parent/block/attribute functions 2026-05-25 13:40:27 +02:00
Fabien Potencier cfaa2fd030 Deprecate the fact that the parent, block, and attribute functions are always allowed in a sandboxed template 2026-05-24 21:19:56 +02:00
Fabien Potencier 4fc0210084 Bump version 2026-05-23 08:32:22 +02:00
Fabien Potencier bd924d5d33 Deprecate the "Twig\Sandbox\SourcePolicyInterface" interface 2026-05-23 08:30:05 +02:00
Alexandre Daubois 9c6b95f2a6 Make in_array() calls strict 2025-02-19 15:29:33 +01:00
Fabien Potencier 151aa4ecda Fix CS 2025-02-14 12:57:03 +01:00
Simon André 82be13429c Add return type annotations on Twig 3 to prepare Twig 4 2025-01-24 11:32:59 +01:00
Nicolas Grekas 04471ab8cd Replace strtr() by strtolower() 2024-09-26 17:48:39 +02:00
Christian Flothmann 8663ec242b fix typo 2024-08-28 14:18:47 +02:00
Fabien Potencier 5fca700cbd Deprecate the fact that the extends and use tags are always allowed in a sandboxed template 2024-08-28 13:40:53 +02:00
Fabien Potencier b63bde3063 Optimize sprintf() calls for PHP 8.4 2024-06-21 08:16:55 +02: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
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 248855b34b Merge branch '2.x' into 3.x
* 2.x:
  Fix premature loop exit in Security Policy lookup of allowed methods/properties
2023-10-26 17:38:13 -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 3fef888756 Merge branch '2.x' into 3.x
* 2.x:
  Add a test
  Added token type and value to error message
  Add phpdoc to SecurityPolicyInterface
2022-03-25 09:18:59 +01:00
Fabien Potencier d6f9a4e7a2 Merge branch '2.x' into 3.x
* 2.x:
  Fix custom escapers when using multiple Twig environments
  Rename variable
2022-03-25 09:06:57 +01:00
Vincent Langlet e33f97cd8b Add phpdoc to SecurityPolicyInterface 2022-03-17 22:53:08 +01:00
Vincent Langlet 3f07c38c9a Rename variable 2022-03-15 08:59:44 +01:00
Fabien Potencier 2dd1d909b9 Fix CS 2021-05-12 09:37:17 +02:00
Fabien Potencier 76352a037d Merge branch '2.x' into 3.x
* 2.x:
  Replace strtolower() with strtr() when dealing with method names
2020-01-08 09:32:39 +01:00
Fabien Potencier 04174b5f62 Merge branch '1.x' into 2.x
* 1.x:
  Replace strtolower() with strtr() when dealing with method names
2020-01-08 09:32:31 +01:00
Matthias Pigulla 30feddef10 Replace strtolower() with strtr() when dealing with method names 2020-01-08 09:27:07 +01:00
Fabien Potencier 54cec4e3b8 added type hints 2019-04-26 12:01:21 +02:00
Fabien Potencier ff58787e23 feature #2962 Change classes marked as @final to final (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Change classes marked as @final to final

Commits
-------

e8a21cfe changed classes marked as @final to final
2019-04-23 17:39:10 +02:00
Fabien Potencier e8a21cfe97 changed classes marked as @final to final 2019-04-23 17:10:12 +02:00
Fabien Potencier c4178fd235 removed obsolete Error features 2019-04-23 17:05:32 +02:00
Fabien Potencier 273b666a71 removed the obsolete lib/ directory, removed PSR-0 class aliases 2019-04-23 16:34:05 +02:00
Fabien Potencier 2973358b15 Merge branch '1.x' into 2.x
* 1.x:
  fixed phpdoc
  fixed tpyo
  bumped version to 1.39.2-DEV
  prepared the 1.39.1 release
2019-04-16 21:17:07 +02:00
Fabien Potencier 7dcd04c83a fixed tpyo 2019-04-16 19:18:48 +02:00
Fabien Potencier a165ce67d4 added the source for all sandbox security exceptions 2019-04-16 18:43:11 +02:00
Fabien Potencier d8cb0f9764 deprecated the 3rd argument of Sandbox error classes 2019-04-16 18:43:11 +02:00
Fabien Potencier 5312086b2d deprecated passing a 4th and 5th arguments to the Sandbox exception classes 2019-04-16 18:13:03 +02:00
Fabien Potencier 712147f6f0 Merge branch '1.x' into 2.x
* 1.x:
  fixed typo
2019-03-19 14:08:27 +01:00
Fabien Potencier f0efbc5b20 fixed typo 2019-03-19 14:07:27 +01:00
Fabien Potencier 1dead73882 added some type hints on constructors 2019-03-16 15:26:39 +01:00
Fabien Potencier 037ee67224 switched to namespace first, PSR-0 as a fallback 2019-03-05 08:14:45 +01:00
Fabien Potencier baa70287f5 switched to namespace first, PSR-0 as a fallback 2019-03-04 21:33:40 +01:00
Fabien Potencier e92a13aae9 replaced require with class_exists 2017-06-05 17:04:19 -07:00
Maxime Steinhausser 2c174e4015 Use class_exists instead of require 2017-06-05 23:42:50 +02:00
Nicolas Grekas c9a2f3db8b [1.x] Allow using namespaced aliases as extension names 2017-05-31 14:35:57 +02:00
Nicolas Grekas 5420a5e3f8 Add the aliases 2017-05-25 08:32:07 +02:00
Nicolas Grekas 71af32b306 Add namespaced aliases 2017-05-24 10:12:32 +02:00