mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 11:56:50 +00:00
Fix for mb function overload mb_substr acting different
This commit is contained in:
committed by
Fabien Potencier
parent
5fd428ed76
commit
214fe52174
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user