Lower mbstring dependency
This commit is contained in:
parent
b3ec567224
commit
6ab671361b
@ -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;
|
||||
|
Reference in New Issue
Block a user