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:
commit
7c6cc013eb
|
@ -263,7 +263,7 @@ class Avatar implements IAvatar {
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function generateAvatar($userDisplayName, $size) {
|
private function generateAvatar($userDisplayName, $size) {
|
||||||
$text = strtoupper($userDisplayName[0]);
|
$text = mb_strtoupper(mb_substr($userDisplayName, 0, 1), 'UTF-8');
|
||||||
$backgroundColor = $this->avatarBackgroundColor($userDisplayName);
|
$backgroundColor = $this->avatarBackgroundColor($userDisplayName);
|
||||||
|
|
||||||
$im = imagecreatetruecolor($size, $size);
|
$im = imagecreatetruecolor($size, $size);
|
||||||
|
|
Loading…
Reference in New Issue