X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FText%2FPlaintext.php;h=be93ac4cdba76a859d3416c8d6925e0ff2e4994a;hb=174052eaf0ea75c31fee631c64ddb0e666c11b8e;hp=b6d767f15999cd461facca3de72288af69ab0668;hpb=c3398511b45a89f8a11626d88dc6bd27bc2494e9;p=friendica.git diff --git a/src/Content/Text/Plaintext.php b/src/Content/Text/Plaintext.php index b6d767f159..be93ac4cdb 100644 --- a/src/Content/Text/Plaintext.php +++ b/src/Content/Text/Plaintext.php @@ -1,6 +1,6 @@ get($uid, 'system', 'simple_shortening')) { + return iconv_substr(iconv_substr(trim($msg), 0, $limit, "UTF-8"), 0, -3, "UTF-8") . $ellipsis; + } + $lines = explode("\n", $msg); $msg = ""; $recycle = html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8'); - $ellipsis = html_entity_decode("…", ENT_QUOTES, 'UTF-8'); foreach ($lines as $row => $line) { if (iconv_strlen(trim($msg . "\n" . $line), "UTF-8") <= $limit) { $msg = trim($msg . "\n" . $line); @@ -169,7 +175,7 @@ class Plaintext } } - $html = BBCode::convert($post['text'] . ($post['after'] ?? ''), false, $htmlmode); + $html = BBCode::convertForUriId($item['uri-id'], $post['text'] . ($post['after'] ?? ''), $htmlmode); $msg = HTML::toPlaintext($html, 0, true); $msg = trim(html_entity_decode($msg, ENT_QUOTES, 'UTF-8')); @@ -241,7 +247,7 @@ class Plaintext } elseif (DI::pConfig()->get($item['uid'], 'system', 'no_intelligent_shortening')) { $post['url'] = $item['plink']; } - $msg = self::shorten($msg, $limit); + $msg = self::shorten($msg, $limit, $item['uid']); } }