Skip to content

Commit 1f6f5fd

Browse files
authored
Update helpers.php
fix unknown image when use name like 'Євген"
1 parent 6ce75a4 commit 1f6f5fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/helpers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function backpack_users_have_email()
5555
*/
5656
function backpack_avatar_url($user)
5757
{
58-
$firstLetter = $user->getAttribute('name') ? $user->name[0] : 'A';
58+
$firstLetter = $user->getAttribute('name') ? mb_substr($user->name, 0, 1, 'UTF-8') : 'A';
5959
$placeholder = 'https://placehold.it/160x160/00a65a/ffffff/&text='.$firstLetter;
6060

6161
switch (config('backpack.base.avatar_type')) {

0 commit comments

Comments
 (0)