From 39f937fb0585e6f764466984c65c95f5dd325d70 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Fri, 15 Feb 2019 17:43:34 +0100 Subject: [PATCH] Fix letter avatar for multibyte characters --- api/src/avatar.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/avatar.php b/api/src/avatar.php index b479c54a29..43c6078ecc 100644 --- a/api/src/avatar.php +++ b/api/src/avatar.php @@ -80,7 +80,7 @@ class avatar $bgcolor = $_color ? $_color : self::_getBgColor($firstname.$lastname.$id); // Letters to be shown - $text = strtoupper($firstname[0].$lastname[0]); + $text = strtoupper(mb_substr($firstname, 0, 1).mb_substr($lastname, 0, 1)); //create an image $image = imagecreatetruecolor($_size, $_size);