From: Fabien Potencier Date: Sat, 28 Jan 2012 15:58:52 +0000 (+0100) Subject: fixed previous commit X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=36d392b0de3b2b4eda9de9897ede51f354bb3d78;p=web%2Fkonrad%2Ftwig.git fixed previous commit --- diff --git a/lib/Twig/Extension/Core.php b/lib/Twig/Extension/Core.php index 9d35ae1..829eb43 100644 --- a/lib/Twig/Extension/Core.php +++ b/lib/Twig/Extension/Core.php @@ -316,10 +316,12 @@ function twig_random(Twig_Environment $env, $values = null) $values = preg_split('/(? $value) { + $values[$i] = twig_convert_encoding($value, $charset, 'UTF-8'); + } } } else { - return substr($values, mt_rand(0, strlen($values)), 1); + return $values[mt_rand(0, strlen($values) - 1)]; } }