Skip to content

Commit

Permalink
Fixed typo in trucate #1943
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed May 20, 2018
1 parent a0946c6 commit b82c17e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion system/src/Grav/Common/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public static function truncate($string, $limit = 150, $up_to_break = false, $br
// 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;
Expand Down

0 comments on commit b82c17e

Please sign in to comment.