// Build the query and fetch the results
$sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type,
- SUBSTRING(comment_content,1,$src_length) AS com_excerpt
+ comment_content AS com_excerpt
FROM $wpdb->comments
LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID)
WHERE comment_approved = '1' AND comment_type = '' AND post_password = ''
@@ -95,9 +95,10 @@
// comment text. This needs to be done if the text is longer than
// the specified length.
$dots = '';
- if ( $src_length <= strlen(strip_tags($comment->com_excerpt)) ) $dots = "...";
+ $comment->com_excerpt = mb_substr(htmlspecialchars($comment->com_excerpt), 0, $src_length);
+ if ( $src_length <= mb_strlen($comment->com_excerpt) ) $dots = "...";