From c8ee4cc49f51ed944a03ab8c469046d0d0922b33 Mon Sep 17 00:00:00 2001 From: hlad Date: Fri, 26 Jul 2019 12:57:39 +0200 Subject: [PATCH] we work with utf8 string so we should use multibyte functions --- include/api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/api.php b/include/api.php index b1bb49c517..23afa72de9 100644 --- a/include/api.php +++ b/include/api.php @@ -2444,8 +2444,8 @@ function api_convert_item($item) $statustext = trim($statustitle."\n\n".$statusbody); } - if ((defaults($item, 'network', Protocol::PHANTOM) == Protocol::FEED) && (strlen($statustext)> 1000)) { - $statustext = substr($statustext, 0, 1000) . "... \n" . defaults($item, 'plink', ''); + if ((defaults($item, 'network', Protocol::PHANTOM) == Protocol::FEED) && (mb_strlen($statustext)> 1000)) { + $statustext = mb_substr($statustext, 0, 1000) . "... \n" . defaults($item, 'plink', ''); } $statushtml = BBCode::convert(api_clean_attachments($body), false); -- 2.39.5