From dd44ba1483b0c83fd567bf461766c61989261892 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 5 Dec 2024 08:10:02 -0800 Subject: [PATCH] Refactor trim method for readability --- event/listener.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/event/listener.php b/event/listener.php index 982c65a..43e90a1 100644 --- a/event/listener.php +++ b/event/listener.php @@ -366,6 +366,8 @@ protected function can_use_notifications() */ protected function trim_shortname($name) { - return htmlspecialchars(utf8_substr(ext::decode_entities($name, ENT_QUOTES), 0, 12), ENT_QUOTES, 'UTF-8'); + $decoded = ext::decode_entities($name, ENT_QUOTES); + $trimmed = utf8_substr($decoded, 0, 12); + return htmlspecialchars($trimmed, ENT_QUOTES, 'UTF-8'); } }