Editor: Ensure latest comments can only be viewed from public posts.

Props: poena, xknown. 

Built from https://develop.svn.wordpress.org/trunk@47984


git-svn-id: http://core.svn.wordpress.org/trunk@47752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
whyisjake 2020-06-10 19:20:11 +00:00
parent 9524b335c7
commit c075eec24f
2 changed files with 8 additions and 3 deletions

View File

@ -596,8 +596,13 @@ function comment_date( $format = '', $comment_ID = 0 ) {
* @return string The possibly truncated comment excerpt. * @return string The possibly truncated comment excerpt.
*/ */
function get_comment_excerpt( $comment_ID = 0 ) { function get_comment_excerpt( $comment_ID = 0 ) {
$comment = get_comment( $comment_ID ); $comment = get_comment( $comment_ID );
$comment_text = strip_tags( str_replace( array( "\n", "\r" ), ' ', $comment->comment_content ) );
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. */ /* translators: Maximum number of words used in a comment excerpt. */
$comment_excerpt_length = intval( _x( '20', 'comment_excerpt_length' ) ); $comment_excerpt_length = intval( _x( '20', 'comment_excerpt_length' ) );

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @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. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.