From: Fabien Potencier Date: Fri, 25 Nov 2011 18:36:25 +0000 (+0100) Subject: fixed a crash under certain versions of PHP when an object with a __toString() method... X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=86214c460186e23c273979bdc2787474eff039e4;p=web%2Fkonrad%2Ftwig.git fixed a crash under certain versions of PHP when an object with a __toString() method is used with htmlspecialchars --- diff --git a/lib/Twig/Extension/Core.php b/lib/Twig/Extension/Core.php index 40cf292..f98ce5a 100644 --- a/lib/Twig/Extension/Core.php +++ b/lib/Twig/Extension/Core.php @@ -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