Fabien Potencier fa405d760d bug #3397 Replace implicit dependence on ext/iconv in JS escaper (JoshyPHP)
This PR was merged into the 2.x branch.

Discussion
----------

Replace implicit dependence on ext/iconv in JS escaper

Twig's JS escaper fails on non-word characters if `ext/iconv` isn't available. That's because it uses iconv to replace characters with their hex codepoints and split characters outside the Basic Multilingual Plane into surrogate pairs. `symfony/polyfill-iconv` does not support the UTF-16BE conversion and cannot be used as a replacement.

This PR splits the surrogates using native PHP, after obtaining the codepoint via `mb_ord()` which is provided either natively or via `symfony/polyfill-mbstring`, which is already part of Twig's requirements.

Commits
-------

b77c2c40 Replace implicit dependence on ext/iconv in JS escaper
2020-09-14 15:15:14 +02:00
2020-08-23 14:01:18 +02:00
2020-07-29 03:03:03 +02:00
2020-08-23 14:19:17 +02:00
2020-08-23 17:55:14 +02:00
2019-10-17 09:29:33 +02:00
2019-08-08 18:07:29 +02:00
2020-05-21 11:54:27 +02:00
2020-08-24 12:05:56 +02:00
2020-08-23 14:01:50 +02:00
2020-06-22 09:23:14 +02:00
2020-02-11 17:31:46 +01:00
2020-08-23 12:46:19 +02:00
2019-06-28 17:37:46 +02: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.

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
Languages
PHP 99.9%