diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 104293b1bc..453a9ae5bf 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -596,8 +596,13 @@ function comment_date( $format = '', $comment_ID = 0 ) { * @return string The possibly truncated comment excerpt. */ function get_comment_excerpt( $comment_ID = 0 ) { - $comment = get_comment( $comment_ID ); - $comment_text = strip_tags( str_replace( array( "\n", "\r" ), ' ', $comment->comment_content ) ); + $comment = get_comment( $comment_ID ); + + if ( ! post_password_required( $comment->comment_post_ID ) ) { + $comment_text = strip_tags( str_replace( array( "\n", "\r" ), ' ', $comment->comment_content ) ); + } else { + $comment_text = __( 'Password protected' ); + } /* translators: Maximum number of words used in a comment excerpt. */ $comment_excerpt_length = intval( _x( '20', 'comment_excerpt_length' ) ); diff --git a/wp-includes/version.php b/wp-includes/version.php index ade54e7178..fc5a1d86d0 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-alpha-47952'; +$wp_version = '5.5-alpha-47984'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.