From: 1emming Date: Sun, 27 Jul 2014 15:37:04 +0000 (+0200) Subject: Fix for mb function overload mb_substr acting different X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=214fe52174f58dc8de67d30fce84a051de2ddb05;p=web%2Fkonrad%2Ftwig.git Fix for mb function overload mb_substr acting different --- diff --git a/lib/Twig/Extension/Core.php b/lib/Twig/Extension/Core.php index 750ef0f..04a6f23 100644 --- a/lib/Twig/Extension/Core.php +++ b/lib/Twig/Extension/Core.php @@ -702,7 +702,7 @@ function twig_slice(Twig_Environment $env, $item, $start, $length = null, $prese $item = (string) $item; if (function_exists('mb_get_info') && null !== $charset = $env->getCharset()) { - return mb_substr($item, $start, null === $length ? mb_strlen($item, $charset) - $start : $length, $charset); + return (string) mb_substr($item, $start, null === $length ? mb_strlen($item, $charset) - $start : $length, $charset); } return null === $length ? substr($item, $start) : substr($item, $start, $length);