mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 11:56:50 +00:00
Use plain string comparison which is twice as fast
This commit is contained in:
@@ -948,7 +948,9 @@ function twig_escape_filter(Twig_Environment $env, $string, $strategy = 'html',
|
||||
return $string;
|
||||
|
||||
case 'url':
|
||||
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
|
||||
// hackish test to avoid version_compare that is much slower, this works unless PHP releases a 5.10.*
|
||||
// at that point however PHP 5.2.* support can be removed
|
||||
if (PHP_VERSION < '5.3.0') {
|
||||
return str_replace('%7E', '~', rawurlencode($string));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user