Merge pull request #8468 from nextcloud/fix-unicode-avatars

Use mb_* string methods to extract first character for generated avatars
This commit is contained in:
Roeland Jago Douma 2018-02-21 11:08:33 +01:00 committed by GitHub
commit 7c6cc013eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -263,7 +263,7 @@ class Avatar implements IAvatar {
* @return string
*/
private function generateAvatar($userDisplayName, $size) {
$text = strtoupper($userDisplayName[0]);
$text = mb_strtoupper(mb_substr($userDisplayName, 0, 1), 'UTF-8');
$backgroundColor = $this->avatarBackgroundColor($userDisplayName);
$im = imagecreatetruecolor($size, $size);