Handle unicode in contact and contactgroup names

This commit is contained in:
Johannes Rauh 2025-04-28 10:58:23 +02:00 committed by Johannes Meyer
parent 8f4401cc72
commit b10044bb8d
2 changed files with 2 additions and 2 deletions

View file

@ -27,7 +27,7 @@ class UserRenderer implements ItemRenderer
$visual->addHtml(
(new Ball($layout === 'minimal' ? Ball::SIZE_BIG : Ball::SIZE_LARGE))
->addAttributes(['class' => 'user-ball'])
->addHtml(Text::create($item->display_name[0]))
->addHtml(Text::create(grapheme_substr($item->display_name, 0, 1)))
);
}

View file

@ -27,7 +27,7 @@ class UsergroupRenderer implements ItemRenderer
$visual->addHtml(
(new Ball($layout === 'minimal' ? Ball::SIZE_BIG : Ball::SIZE_LARGE))
->addAttributes(['class' => 'usergroup-ball'])
->addHtml(Text::create($item->display_name[0]))
->addHtml(Text::create(grapheme_substr($item->display_name, 0, 1)))
);
}