Fixed Page::summary() when using delimiter and multibyte UTF8 Characters #1644

This commit is contained in:
Andy Miller
2017-09-11 08:56:50 -06:00
parent f2898f9f20
commit 79fa88c315
2 changed files with 9 additions and 3 deletions

View File

@@ -1,3 +1,9 @@
# v1.3.4
## xx/xx/2017
1. [](#bugfix)
* Fixed `Page::summary()` when using delimiter and multibyte UTF8 Characters [#1644](https://github.com/getgrav/grav/issues/1644)
# v1.3.3
## 09/07/2017
@@ -19,7 +25,7 @@
* Updated vendor libraries
* Updated `travis.yml` to add support for PHP 7.1 as well as 7.0.21 for test suite
1. [](#bugfix)
* Fixed UTF8 2 character support in `Page::summary()` [#1554](https://github.com/getgrav/grav/issues/1554)
* Fixed UTF8 multibyte UTF8 character support in `Page::summary()` [#1554](https://github.com/getgrav/grav/issues/1554)
# v1.3.2
## 08/16/2017

View File

@@ -520,7 +520,7 @@ class Page
} elseif (($format === 'short') && isset($summary_size)) {
// Use mb_strimwidth to slice the string
if (mb_strwidth($content, 'utf8') > $summary_size) {
return mb_strimwidth($content, 0, $summary_size);
return mb_substr($content, 0, $summary_size);
} else {
return $content;
}
@@ -2269,7 +2269,7 @@ class Page
return false;
}
/**
* Returns the item in the current position.
*