1
0
Fork 0
mirror of synced 2024-10-02 10:16:27 +13:00

Remove Special Chars from Initials

This commit is contained in:
Bradley Schofield 2023-09-06 09:54:59 +01:00
parent 7b448527a6
commit 8e0e131824

View file

@ -526,8 +526,10 @@ App::get('/v1/avatars/initials')
$code = 0;
foreach ($words as $key => $w) {
$initials .= $w[0] ?? '';
$code += (isset($w[0])) ? \ord($w[0]) : 0;
if (ctype_alnum($w[0] ?? '')) {
$initials .= $w[0];
$code += ord($w[0]);
}
if ($key == 1) {
break;