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

Commit 8e07caf

Browse files
committed
strip tags, so that strlen would count only real text
see #41
1 parent b793168 commit 8e07caf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

includes/class-linkbacks-handler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ public static function comment_text_excerpt( $text, $comment = null, $args = arr
587587
$host = preg_replace( '/^www\./', '', $host );
588588

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

0 commit comments

Comments
 (0)