mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-31 12:37:15 +00:00
83f26e402b66c6bd837548cbbca5444242219e49
This PR was squashed before being merged into the 1.x branch.
Discussion
----------
Fix: A template name cannot be an absolute path
fixes #3209, https://github.com/PrestaShop/PrestaShop/issues/20709
The source of this is in https://github.com/twigphp/Twig/blob/v3.3.0/src/Loader/FilesystemLoader.php#L212 which NEVER accepts an absolute name (path is always prefixed with path). As discussed in https://github.com/twigphp/Twig/issues/3209#issuecomment-814816613.
The original code emit php warning when `open_basedir` is set on Windows on NTS PHP build (because of PHP inconsistency between TS and NTS, see https://bugs.php.net/bug.php?id=78939). This PR fixes this issue and no warning is emitted.
This fix is important as Symfony relies on exception when absolute path is given in https://github.com/symfony/symfony/blob/v3.4.47/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php#L82.
Please merge and issue a patch release for every major Twig version.
Commits
-------
3a67fc7d Fix: A template name cannot be an absolute path
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.
Sponsors
--------
.. raw:: html
<a href="https://blackfire.io/docs/introduction?utm_source=twig&utm_medium=github_readme&utm_campaign=logo">
<img src="https://static.blackfire.io/assets/intemporals/logo/png/blackfire-io_secondary_horizontal_transparent.png?1" width="255px" alt="Blackfire.io">
</a>
More Information
----------------
Read the `documentation`_ for more information.
.. _documentation: https://twig.symfony.com/documentation
Description
Languages
PHP
99.9%