mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-31 20:47:28 +00:00
fixed url escaping strategy for PHP 5.2
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user