Truncate Client Name on client side nav

This commit is contained in:
johnnyq
2023-09-08 01:51:29 -04:00
parent 21a60c0619
commit 6cb3d8f9d0
2 changed files with 5 additions and 2 deletions

View File

@@ -192,7 +192,10 @@ function truncate($text, $chars) {
}
$text = $text." ";
$text = substr($text, 0, $chars);
$text = substr($text, 0, strrpos($text, ' '));
$lastSpacePos = strrpos($text, ' ');
if ($lastSpacePos !== false) {
$text = substr($text, 0, $lastSpacePos);
}
return $text."...";
}