Merge pull request #8922 from lhalaa/pulls/dbtext-multibyte

FIX Replace substr with mb_substr to get the correct position
This commit is contained in:
Robbie Averill 2019-04-15 23:14:06 +12:00 committed by GitHub
commit be9f0120ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -206,8 +206,8 @@ class DBText extends DBString
if ($position > 0) {
// We don't want to start mid-word
$position = max(
(int) mb_strrpos(substr($text, 0, $position), ' '),
(int) mb_strrpos(substr($text, 0, $position), "\n")
(int) mb_strrpos(mb_substr($text, 0, $position), ' '),
(int) mb_strrpos(mb_substr($text, 0, $position), "\n")
);
}