Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
strip tags, so that strlen would count only real text
Browse files Browse the repository at this point in the history
see #41
  • Loading branch information
pfefferle committed May 6, 2020
1 parent b793168 commit 8e07caf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/class-linkbacks-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ public static function comment_text_excerpt( $text, $comment = null, $args = arr
$host = preg_replace( '/^www\./', '', $host );

// generate output. use full content if it's small enough, otherwise use excerpt.
$text_len = mb_strlen( html_entity_decode( $text, ENT_QUOTES ) );
$text_len = mb_strlen( wp_strip_all_tags( html_entity_decode( $text, ENT_QUOTES ) ) );
if ( ! ( 'mention' === $semantic_linkbacks_type && $text_len <= MAX_INLINE_MENTION_LENGTH ) ) {
$text = sprintf( $comment_type_excerpts[ $semantic_linkbacks_type ], get_comment_author_link( $comment->comment_ID ), $post_type, $url, $host );
}
Expand Down

0 comments on commit 8e07caf

Please sign in to comment.