fixed a crash under certain versions of PHP when an object with a __toString() method...
authorFabien Potencier <fabien.potencier@gmail.com>
Fri, 25 Nov 2011 18:36:25 +0000 (19:36 +0100)
committerFabien Potencier <fabien.potencier@gmail.com>
Fri, 25 Nov 2011 18:36:25 +0000 (19:36 +0100)
lib/Twig/Extension/Core.php

index 40cf292..f98ce5a 100644 (file)
@@ -498,6 +498,8 @@ function twig_escape_filter(Twig_Environment $env, $string, $type = 'html', $cha
         $charset = $env->getCharset();
     }
 
+    $string = (string) $string;
+
     switch ($type) {
         case 'js':
             // escape all non-alphanumeric characters