From 8e0e131824fe2cf6a563613007072a614fbb65a6 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 6 Sep 2023 09:54:59 +0100 Subject: [PATCH] Remove Special Chars from Initials --- app/controllers/api/avatars.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index 3b93348643..a4df9431eb 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -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;