From 63360f80482d860495900a39282b54680f38cd45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sheila=20Ba=C3=B1ez?= Date: Mon, 15 Apr 2019 16:38:52 +1200 Subject: [PATCH] BUG Replace substr with mb_substr to get the correct position --- src/ORM/FieldType/DBText.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ORM/FieldType/DBText.php b/src/ORM/FieldType/DBText.php index c719a525d4d..e64d4c421dd 100644 --- a/src/ORM/FieldType/DBText.php +++ b/src/ORM/FieldType/DBText.php @@ -206,8 +206,8 @@ public function ContextSummary( 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") ); }