Skip to content

Commit

Permalink
Refactor trim method for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
iMattPro committed Dec 5, 2024
1 parent 5562c03 commit dd44ba1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion event/listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}

0 comments on commit dd44ba1

Please sign in to comment.