From 824ee015874bdceebd98fab233ed9406c8076614 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20CAPARROS?= Date: Wed, 21 Jun 2017 12:16:07 +0200 Subject: [PATCH] Fix substr on unicode string --- classes/observer/typing.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/observer/typing.php b/classes/observer/typing.php index 9f31d686a..9bd03a2b6 100644 --- a/classes/observer/typing.php +++ b/classes/observer/typing.php @@ -261,9 +261,9 @@ public static function type_string($var, array $settings) if (array_key_exists('character_maximum_length', $settings)) { $length = intval($settings['character_maximum_length']); - if ($length > 0 and strlen($var) > $length) + if ($length > 0 and mb_strlen($var) > $length) { - $var = substr($var, 0, $length); + $var = mb_substr($var, 0, $length); } }