BUG Replace substr with mb_substr to get the correct position

This commit is contained in:
Sheila Bañez 2019-04-15 16:38:52 +12:00
parent f2f28586d9
commit 63360f8048

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")
);
}