diff --git a/inc/display.php b/inc/display.php index fe33f4c1..5f4cae6f 100644 --- a/inc/display.php +++ b/inc/display.php @@ -116,10 +116,13 @@ // Unescape HTML characters, to avoid splitting them in half $body = html_entity_decode_utf8($body); - $body = substr($body, 0, $len) . (strlen($body) > $len ? '…' : ''); + // calculate strlen() so we can add "..." after if needed + $strlen = strlen($body); + + $body = substr($body, 0, $len); // Re-escape the characters. - return '' . utf8tohtml($body) . ''; + return '' . utf8tohtml($body) . ($strlen > $len ? '…' : '') . ''; } function capcode($cap) {