mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-31 04:27:00 +00:00
d632fd3c33ff2a8115428f9ac3a154cb7d8dc82f
This PR was merged into the 1.x branch.
Discussion
----------
Throw exception on circular reference detection
Out-the-box this isn't common... but into Symfony framework this kind of issue can happen frequently when we're overriding a template from third-party bundle (see main issue https://github.com/symfony/symfony/issues/17557)
```twig
{# app/Resources/AcmeBlogBundle/views/Blog/index.html.twig #}
{% extends '@AcmeBlog/Blog/index.html.twig' %}
{% block title 'New Title' %}
```
This exception avoids inifite loop or maximum execution time for this case, by detecting a recursive loading when a template extends from itself, thinking to override the parent template which has the same namespace + template name.
Commits
-------
074e1fbe Throw exception on circular reference detection
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
Description
Languages
PHP
99.9%