projects
/
web/konrad/twig.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
d4eec01
)
Use plain string comparison which is twice as fast
author
Jordi Boggiano
<j.boggiano@seld.be>
Mon, 6 May 2013 12:09:40 +0000 (14:09 +0200)
committer
Jordi Boggiano
<j.boggiano@seld.be>
Mon, 6 May 2013 12:09:40 +0000 (14:09 +0200)
lib/Twig/Extension/Core.php
patch
|
blob
|
history
diff --git
a/lib/Twig/Extension/Core.php
b/lib/Twig/Extension/Core.php
index
38ac008
..
e0a6a33
100644
(file)
--- a/
lib/Twig/Extension/Core.php
+++ b/
lib/Twig/Extension/Core.php
@@
-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));
}