Fabien Potencier e9ce4607d4 bug #2052 fix a case where the autoescaping does not work as expected (uwej711)
This PR was merged into the 1.x branch.

Discussion
----------

fix a case where the autoescaping does not work as expected

The Twig_NodeVisitor_Escaper collects a list of blocks for all templates that it visits. If you define the same block (i.e. with the same name) in txt and html templates this results sometimes in the html block not being escapes.

This is illustrated in the added test.

To fix it, I propose to reset the list of the blocks for each module.

Alternatively we need to make clear that blocks should not share names between text and html templates.

Commits
-------

48a3487 Reset blocks also in doLeaveNode
ee6965e fix a case where the autoescaping does not work as expected
2016-06-08 17:42:12 +02:00
2016-05-20 08:13:46 +02:00
2016-05-30 11:17:27 +02:00
2016-06-02 08:55:29 +02:00
2016-05-30 11:17:27 +02:00
2016-01-25 22:21:03 +01:00
2016-01-01 02:33:03 +01:00

Twig, the flexible, fast, and secure template language for PHP
==============================================================

Twig is a template language for PHP, released under the new BSD license (code
and documentation).

Twig uses a syntax similar to the Django and Jinja template languages which
inspired the Twig runtime environment.

More Information
----------------

Read the `documentation`_ for more information.

.. _documentation: http://twig.sensiolabs.org/documentation
Languages
PHP 99.9%