Fixed typo in trucate #1943

This commit is contained in:
Andy Miller
2018-05-20 12:01:38 -06:00
parent a0946c67b9
commit b82c17ea56
2 changed files with 2 additions and 1 deletions

View File

@@ -14,6 +14,7 @@
1. [](#bugfix)
* Fixed bug in `ContentBlock` serialization
* Fixed `Route::withQueryParam()` to accept array values
* Fixed typo in truncate function [#1943](https://github.com/getgrav/grav/issues/1943)
# v1.4.4
## 05/11/2018

View File

@@ -262,7 +262,7 @@ abstract class Utils
// is $break present between $limit and the end of the string?
if ($up_to_break && false !== ($breakpoint = mb_strpos($string, $break, $limit))) {
if ($breakpoint < mb_strlen($string) - 1) {
$string = mb_substr($string, 0, $breakpoint) . $break;
$string = mb_substr($string, 0, $breakpoint) . $pad;
}
} else {
$string = mb_substr($string, 0, $limit) . $pad;