From: Fabien Potencier Date: Wed, 27 Jun 2012 09:18:21 +0000 (+0200) Subject: fixed url escaping strategy for PHP 5.2 X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=73d117e672192a6758f5cbaac006e565d883dfed;p=web%2Fkonrad%2Ftwig.git fixed url escaping strategy for PHP 5.2 --- diff --git a/lib/Twig/Extension/Core.php b/lib/Twig/Extension/Core.php index 0ebabc0..ed9ef2d 100644 --- a/lib/Twig/Extension/Core.php +++ b/lib/Twig/Extension/Core.php @@ -872,6 +872,10 @@ function twig_escape_filter(Twig_Environment $env, $string, $strategy = 'html', return twig_convert_encoding($string, $charset, 'UTF-8'); case 'url': + if (version_compare(PHP_VERSION, '5.3.0', '<')) { + return str_replace('%7E', '~', rawurlencode($string)); + } + return rawurlencode($string); default: