diff --git a/administrator/components/com_search/helpers/search.php b/administrator/components/com_search/helpers/search.php index a096b90b3bb92..6e3720f7aea51 100644 --- a/administrator/components/com_search/helpers/search.php +++ b/administrator/components/com_search/helpers/search.php @@ -347,7 +347,12 @@ public static function _smartSubstr($text, $searchword) } else { - if (($wordpos = @StringHelper::strpos($text, ' ', $length)) !== false) + if (($mbtextlen = StringHelper::strlen($text)) < $length) + { + $length = $mbtextlen; + } + + if (($wordpos = StringHelper::strpos($text, ' ', $length)) !== false) { return StringHelper::substr($text, 0, $wordpos) . ' ...'; }