diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php index 3b3b28f570..c6c3ebb284 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php @@ -211,12 +211,8 @@ abstract class Descriptor implements DescriptorInterface if (is_bool($value) || is_array($value) || (null === $value)) { $jsonString = json_encode($value); - if (!function_exists('mb_strlen')) { - return substr($jsonString, 0, 60).(strlen($jsonString) > 60 ? ' ...' : ''); - } - - if (mb_strlen($jsonString) > 60) { - return mb_substr($jsonString, 0, 60).' ...'; + if (preg_match('/^(.{60})./us', $jsonString, $matches)) { + return $matches[1].'...'; } return $jsonString;