Skip to content

Commit dd44ba1

Browse files
committed
Refactor trim method for readability
1 parent 5562c03 commit dd44ba1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

event/listener.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,8 @@ protected function can_use_notifications()
366366
*/
367367
protected function trim_shortname($name)
368368
{
369-
return htmlspecialchars(utf8_substr(ext::decode_entities($name, ENT_QUOTES), 0, 12), ENT_QUOTES, 'UTF-8');
369+
$decoded = ext::decode_entities($name, ENT_QUOTES);
370+
$trimmed = utf8_substr($decoded, 0, 12);
371+
return htmlspecialchars($trimmed, ENT_QUOTES, 'UTF-8');
370372
}
371373
}

0 commit comments

Comments
 (0)