From 9203c9a6c03baa93a6705e732053112e06672efd Mon Sep 17 00:00:00 2001 From: Pedram Azimaei Date: Tue, 1 Oct 2019 12:32:47 +0330 Subject: [PATCH] Update Assertion.php Fixing stringify to handle UTF-8 texts --- lib/Assert/Assertion.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Assert/Assertion.php b/lib/Assert/Assertion.php index 6f5b3c2d..925678a3 100644 --- a/lib/Assert/Assertion.php +++ b/lib/Assert/Assertion.php @@ -2768,8 +2768,8 @@ protected static function stringify($value): string } elseif (\is_scalar($value)) { $val = (string)$value; - if (\strlen($val) > 100) { - $val = \substr($val, 0, 97).'...'; + if (\mb_strlen($val) > 100) { + $val = \mb_substr($val, 0, 97).'...'; } $result = $val;