Skip to content

Commit

Permalink
fix error: redundant space before ellipsis. It had an effect on previ…
Browse files Browse the repository at this point in the history
…ous implementation.
  • Loading branch information
ksucherek committed Mar 8, 2021
1 parent 6ee8e39 commit cb7367f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Utilities/Strings.php
Original file line number Diff line number Diff line change
Expand Up @@ -492,10 +492,10 @@ public static function abbreviate($string, $maxWidth, $toWholeWord = false)
}

if ($toWholeWord) {
$lastSpace = mb_strrpos($string, ' ', -($fullLength - $maxWidth));
$maxWidth = $lastSpace ? min($maxWidth, $lastSpace) : $maxWidth;
$lastSpace = mb_strrpos($string, ' ', -($fullLength - $maxWidth) + 1);
$maxWidth = $lastSpace ? $lastSpace+1 : $maxWidth;
}
return trim(mb_substr($string, 0, $maxWidth)) . ' ...';
return mb_substr($string, 0, $maxWidth) . '...';
}

/**
Expand Down

0 comments on commit cb7367f

Please sign in to comment.