34 Commits

Author SHA1 Message Date
Fabien Potencier 2102dd1359 Fix a security issue when an included sandboxed template has been loaded before without the sandbox context 2024-09-09 19:08:51 +02: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
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 9c03ef0d21 Fix custom escapers when using multiple Twig environments 2022-03-25 08:56:44 +01:00
Fabien Potencier 2eb3308055 Disallow non closures in sort filter when the sanbox mode is enabled 2022-02-04 07:52:21 +01:00
Nicolas Grekas 1d0bab9d63 Add explicit @return type next to #[ReturnTypeWillChange] 2021-08-10 18:49:26 +02:00
Alex Pott 98c2233e47 Twig2 PHP 8.1 beta compatibility 2021-07-28 09:49:43 +01:00
Fabien Potencier feeaba3fea Merge branch '1.x' into 2.x
* 1.x:
  Explicitly specify the encoding for mb_ord in JS escaper
2021-07-08 13:01:04 +02:00
Fabien Potencier 157fa56829 Merge branch '1.x' into 2.x
* 1.x:
  Fix CS
  Migrate to the new PHP CS Fixer config file
2021-05-12 09:27:30 +02:00
Fabien Potencier 59f3e8e5dc Fix CS 2021-05-12 09:19:37 +02:00
Fabien Potencier 497f027cd4 Merge branch '1.x' into 2.x
* 1.x:
  Fix "include(template_from_string())"
  Fix PHPUnit config
2020-10-27 15:14:55 +01:00
Fabien Potencier df9c9f2165 Fix "include(template_from_string())" 2020-10-27 13:39:31 +01:00
Fabien Potencier ab6695b580 Merge branch '1.x' into 2.x
* 1.x:
  Fix sandbox support when using include(template_from_string())
  Add test to verify that filter is not working when template_from_string is used.
  In |filter(), |map(), and |reduce(), throw a RuntimeError instead of a TypeError
2020-08-23 17:55:14 +02:00
Fabien Potencier c7be1bb3c4 Fix sandbox support when using include(template_from_string()) 2020-08-23 17:48:34 +02:00
Bozhidar Hristov 04431228af Add test to verify that filter is not working when template_from_string is used. 2020-08-23 17:46:12 +02:00
Fabien Potencier 9bf49d5ccf Merge branch '1.x' into 2.x
* 1.x:
  Update CHANGELOG
  Fix previous merge
  Make round brackets optional for one argument tests like sameas
2020-08-23 14:22:09 +02:00
Andreas 1ee72d9e15 Make round brackets optional for one argument tests like sameas 2020-08-23 14:16:31 +02:00
Fabien Potencier 81612a5c7d Merge branch '1.x' into 2.x
* 1.x:
  Fix CS
2020-08-23 13:49:18 +02:00
Fabien Potencier bde54e11b8 Fix CS 2020-08-23 13:48:32 +02:00
Fabien Potencier 38bd74d03a Merge branch '1.x' into 2.x
* 1.x:
  Add a test
  fix typo in ApplyTokenParser PHP doc
  Fixes #3351
2020-08-05 16:53:59 +02:00
Bozhidar Hristov 04658c9f59 Fixes #3351 2020-07-09 14:43:36 +02:00
Fabien Potencier d190c2e7f7 Merge branch '1.x' into 2.x
* 1.x:
  Restrict callables to closures in filters
2020-07-05 15:32:43 +02:00
Jérémy Derussé d8259519c0 Restrict callables to closures in filters 2020-07-05 15:30:15 +02:00
Nicolas Grekas 791f001ae6 Merge branch '1.x' into 2.x
* 1.x:
  Minor fixes
2020-05-21 11:15:20 +02:00
Nicolas Grekas 5dc364469b Minor fixes 2020-05-21 11:01:36 +02:00
Nicolas Grekas b845ed969e Twig 2 is compatible with PHP 7.0 2019-09-20 15:13:40 +02:00
Fabien Potencier 656c295ed9 Merge branch '1.x' into 2.x
* 1.x:
  removed usage of getmockBuilder() when not needed
2019-08-08 13:33:07 +02:00
Fabien Potencier 5861a539e4 removed usage of getmockBuilder() when not needed 2019-08-08 11:59:51 +02:00
Jérémy Derussé f348f6ea64 Fix compatibility with PHPUnit 8 2019-08-08 11:06:58 +02:00
Fabien Potencier 5ebcecf24b Fix PHPUnit deprecations 2019-08-08 11:03:05 +02:00
Fabien Potencier c829dafd75 Merge branch '1.x' into 2.x
* 1.x:
  Update to PhpUnitBridge and fix deprecations
2019-08-08 10:19:01 +02:00
Jérémy Derussé b776e41f5a Update to PhpUnitBridge and fix deprecations 2019-08-08 09:39:49 +02:00
Fabien Potencier 1e3bb75010 moved test under tests/ 2019-06-30 14:51:54 +02:00
Fabien Potencier 22a1317249 moved tests under tests/ 2019-06-30 14:48:27 +02:00