Commit Graph

2575 Commits

Author SHA1 Message Date
Fabien Potencier 499d4e7d60 bug #1763 Remove broken code (stof)
This PR was merged into the 1.x branch.

Discussion
----------

Remove broken code

https://github.com/twigphp/Twig/commit/651613c32c315bbeb330b2a6354b34c288e9ea0a#diff-841d1051670799376e88c87114d2caf0 broke the code of ``Twig_Node_Module::compileLoadTemplate`` when passing a non-constant node (it triggers a fatal error)
Trait templates can only be constant expression nodes, so fixing the broken is not actually needed and it can be removed.
Given it is a protected method, I haven't changed the signature to typehint the node as a Twig_Node_Expression_Constant

Commits
-------

e6ae0d0 Remove broken code
2015-08-15 21:53:40 +02:00
Fabien Potencier af129b2f75 fixed typos and CS 2015-08-13 14:50:40 +02:00
Fabien Potencier 5f5d8b0647 minor #1762 [doc/recipes] Added OPcache support (iKwinto)
This PR was submitted for the master branch but it was merged into the 1.x branch instead (closes #1762).

Discussion
----------

[doc/recipes] Added OPcache support

OPcache enabled by default cache sinse PHP 5.5.

Commits
-------

1f3fb9a [doc/recipes] Added OPcache support
2015-08-13 14:49:08 +02:00
Alexander Vasilyev 1f3fb9a178 [doc/recipes] Added OPcache support 2015-08-13 14:49:08 +02:00
Christophe Coevoet e6ae0d0caa Remove broken code
Trait templates can only be constant expression nodes, so fixing the
broken is not actually needed and it can be removed.
2015-08-13 10:32:03 +02:00
Fabien Potencier 37553291e6 bumped version to 1.20.1-DEV 2015-08-12 18:01:39 +02:00
Fabien Potencier 1ea4e5f81c prepared the 1.20.0 release v1.20.0 2015-08-12 17:56:39 +02:00
Fabien Potencier 8b5ac1c86b security #1759 Some various changes (fabpot, stof, tucksaun)
This PR was merged into the 1.x branch.

Discussion
----------

Some various changes

Commits
-------

e5b7c03 updated CHANGELOG
2250060 Fix the accessibility of Twig_Template::getEnvironment method in the C ext
e000420 Fix the handling of internal Twig_Template properties in the C ext
a8a125b Forbid access to the Twig environment from template instance
30be077 fixed sandbox security issue
7b6c0e9 Prevent importing or calling reserved macro names
2015-08-12 17:53:26 +02:00
Fabien Potencier e5b7c0359d updated CHANGELOG 2015-08-12 17:44:22 +02:00
Tugdual Saunier 22500609b6 Fix the accessibility of Twig_Template::getEnvironment method in the C ext 2015-08-12 17:44:05 +02:00
Christophe Coevoet e000420096 Fix the handling of internal Twig_Template properties in the C ext 2015-08-12 17:44:05 +02:00
Christophe Coevoet a8a125ba9b Forbid access to the Twig environment from template instance
This also forbids access to other internal parts of the Twig_Template.
2015-08-12 17:44:05 +02:00
Fabien Potencier 30be07759a fixed sandbox security issue 2015-08-12 17:44:05 +02:00
Christophe Coevoet 7b6c0e971f Prevent importing or calling reserved macro names
This also fixes the logic detecting reserved macro names to account for
the fact that they are compiled prefixed with get() since a very long
time and the logic preventing conflicts was broken.
2015-08-12 17:44:05 +02:00
Fabien Potencier cfb0593028 feature #1757 deprecated Twig_Template::getEnvironment() (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

deprecated Twig_Template::getEnvironment()

Commits
-------

c9501b8 deprecated Twig_Template::getEnvironment()
2015-08-12 16:50:28 +02:00
Fabien Potencier c9501b80a1 deprecated Twig_Template::getEnvironment() 2015-08-12 16:49:10 +02:00
Fabien Potencier 1eb5fb26ef feature #1754 deprecated _self (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

deprecated _self

It never makes sense to use the `_self` variable in a template except for the special `from` and `import` usage. So, I propose to deprecate it in 2.x and remove the unexcepted possible usages in 3.0.

Commits
-------

5514c8e deprecated _self
2015-08-12 11:10:10 +02:00
Fabien Potencier 5514c8ee80 deprecated _self 2015-08-12 11:08:46 +02:00
Fabien Potencier 61d45b3e24 feature #1753 added a base node visitor to make compat between 1.x and 2.x possible (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

added a base node visitor to make compat between 1.x and 2.x possible

As suggested in #1644, that allows better compat between 1.x and 2.x

Commits
-------

881fb63 added a base node visitor to make compat between 1.x and 2.x possible
3f521d4 bumped to 1.20
2015-08-11 15:57:52 +02:00
Fabien Potencier 881fb63bf7 added a base node visitor to make compat between 1.x and 2.x possible 2015-08-11 15:38:01 +02:00
Fabien Potencier 3f521d483f bumped to 1.20 2015-08-11 15:22:12 +02:00
Fabien Potencier e375c9c562 added a mention of projects using Twig 2015-08-04 16:19:10 +02:00
Fabien Potencier 617eaa0009 bumped version to 1.19.1-DEV 2015-07-31 15:50:08 +02:00
Fabien Potencier edbeaf43b0 prepared the 1.19.0 release v1.19.0 2015-07-31 15:45:26 +02:00
Fabien Potencier b18bcfb390 updated CHANGELOG 2015-07-31 15:35:58 +02:00
Fabien Potencier b1385c056d bug #1746 Fixed error guessing in blocks in a child template (hason)
This PR was merged into the 1.x branch.

Discussion
----------

Fixed error guessing in blocks in a child template

Commits
-------

cfa1404 Fixed error guessing in blocks in a child template
2015-07-31 15:33:46 +02:00
Martin Hasoň cfa14046ab Fixed error guessing in blocks in a child template 2015-07-31 14:43:10 +02:00
Fabien Potencier 1ded65daeb fixed CS 2015-07-05 10:50:23 +02:00
Fabien Potencier 0828c0345a tweaked docs 2015-07-05 10:48:49 +02:00
Fabien Potencier e007c178ec feature #1699 Added variadic filters, tests, and functions (hason)
This PR was merged into the 1.x branch.

Discussion
----------

Added variadic filters, tests, and functions

Replaces #1317

```php
$env->addFunction(new Twig_SimpleFunction('foo', function ($a1, array $args = array()) {
}, array('is_variadic' => true));
```
```jinja
{{ foo(1, 2, a="a", b="b") }}
{# foo(1, array(0 => 2, "a" => "a", "b" => "b")); #}
```

Commits
-------

c78656a Added variadic filters, tests, and functions
2015-07-05 10:27:16 +02:00
Fabien Potencier 056bb5dade fixed CS 2015-07-05 10:26:11 +02:00
Fabien Potencier ea2648768e bumped version to 1.19 2015-07-05 10:14:03 +02:00
Fabien Potencier 5020747987 feature #1659 Added support for unconsumed macro arguments (hason)
This PR was merged into the 1.x branch.

Discussion
----------

Added support for unconsumed macro arguments

Fixes #1159 and supplements #1699

Commits
-------

7f00cb9 Added support for unconsumed macro arguments
2015-07-05 10:12:21 +02:00
Fabien Potencier 82636dc93d fixed PHP 5.2 compat 2015-07-03 12:11:52 +02:00
Fabien Potencier 641090378d tweaked previous merge 2015-07-03 11:46:19 +02:00
Fabien Potencier 35790250b8 bug #1666 add ignore_missing agrument to source function (vetruvet)
This PR was submitted for the master branch but it was merged into the 1.x branch instead (closes #1666).

Discussion
----------

add ignore_missing agrument to source function

This basically works the same way as `ignore_missing` on the `include` function/tag.

Commits
-------

afa9358 add ignore_missing agrument to source function
2015-07-03 11:44:24 +02:00
Valeriy Trubachev afa93586bc add ignore_missing agrument to source function 2015-07-03 11:44:24 +02:00
Fabien Potencier 793ea7e37d updated CHANGELOG 2015-07-03 11:41:40 +02:00
Fabien Potencier 849adeb85e fixed edge case where tests would fail because of a cache issue 2015-07-03 11:33:17 +02:00
Fabien Potencier d472fcc9bd tweaked docs to avoid using an internal method in an example 2015-07-03 11:30:18 +02:00
Fabien Potencier 61eb80b089 deprecated Twig_Environment::clearTemplateCache() 2015-07-03 11:29:18 +02:00
Fabien Potencier 1255e360e7 bug #1725 fixed sandbox disabling when using the include function (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

fixed sandbox disabling when using the include function

closes #1668

Commits
-------

af72894 fixed sandbox disabling when using the include function
2015-07-03 11:20:29 +02:00
Fabien Potencier af728947d6 fixed sandbox disabling when using the include function 2015-07-03 09:28:58 +02:00
Fabien Potencier 90026f3f99 minor #1720 Example about how to rename several blocks (pyguerder)
This PR was submitted for the master branch but it was merged into the 1.x branch instead (closes #1720).

Discussion
----------

Example about how to rename several blocks

It was unclear to me how to rename more than 1 imported block. I had to look into the source code to find that, so I add it to the documentation.

Commits
-------

8af1355 Example about how to rename several blocks
2015-07-03 09:00:14 +02:00
Pierre-Yves Guerder 8af1355e43 Example about how to rename several blocks
It was unclear to me how to rename more than 1 imported block. I had to look into the source code to find that, so I add it to the documentation.
2015-07-03 09:00:13 +02:00
Fabien Potencier 7823014351 fixed docs 2015-07-03 08:59:01 +02:00
Fabien Potencier 1ee34b4bd5 minor #1723 Update batch filter docs with arguments (alexeymalihin)
This PR was submitted for the master branch but it was merged into the 1.x branch instead (closes #1723).

Discussion
----------

Update batch filter docs with arguments

Changes based on https://github.com/twigphp/Twig/blob/1.x/test/Twig/Tests/Fixtures/filters/batch_float.test

Commits
-------

b66821e Update batch filter docs with arguments
2015-07-03 08:57:29 +02:00
Alexey Malihin b66821e861 Update batch filter docs with arguments 2015-07-03 08:57:29 +02:00
Fabien Potencier b0c41d42c4 fixed CS 2015-07-03 08:47:09 +02:00
Fabien Potencier d00943bb56 bug #1724 fix batch filter with zero items (Tobion)
This PR was merged into the 1.x branch.

Discussion
----------

fix batch filter with zero items

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

also added a test for preserving keys behavior

Commits
-------

8d6be28 fix batch filter with zero items
2015-07-03 08:37:27 +02:00