From 73d117e672192a6758f5cbaac006e565d883dfed Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 27 Jun 2012 11:18:21 +0200 Subject: [PATCH] fixed url escaping strategy for PHP 5.2 --- lib/Twig/Extension/Core.php | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) 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: -- 1.7.2.5