Fabien Potencier 0a0febc32b merged branch arnaud-lb/twig-escape-filter-opt (PR #537)
Commits
-------

7b8d476 optimized twig_escape_filter

Discussion
----------

Optimized twig_escape_filter

This optimizes the part of twig_escape_filter that checks if the charset is supported by htmlspecialchars.

This uses a static variable to avoid initializing the charsets array each time the function is called; and does a hash lookup instead of array search (saves a function call too).

The optimized version takes 66% less time that the original version on html escaping :) (no difference on js escaping).
2011-11-27 16:46:10 +01:00
2011-11-21 09:41:49 +01:00
2011-11-23 14:01:51 +01:00
2011-11-27 16:13:43 +01:00
2011-11-23 12:21:50 +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.

Languages
PHP 99.9%