Make WordPress Core


Ignore:
Timestamp:
10/12/2023 03:04:07 PM (2 years ago)
Author:
davidbaumwald
Message:

Grouped backports to the 5.2 branch.

  • Comments: Prevent users who can not see a post from seeing comments on it.
  • Shortcodes: Restrict media shortcode ajax to certain type.
  • REST API: Ensure no-cache headers are sent when methods are overridden.
  • REST API: Limit search_columns for users without list_users.
  • Prevent unintended behavior when certain objects are unserialized.

Merges [56833], [56834], [56835], [56836], and [56838] to the 5.2 branch.
Props xknown, jorbin, joehoyle, timothyblynjacobs, peterwilsoncc, ehtis, tykoted, antpb, rmccue.

Location:
branches/5.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.2

  • branches/5.2/src/wp-admin/includes/dashboard.php

    r45510 r56876  
    946946        echo '<ul id="the-comment-list" data-wp-lists="list:comment">';
    947947        foreach ( $comments as $comment ) {
    948             _wp_dashboard_recent_comments_row( $comment );
     948            $comment_post = get_post( $comment->comment_post_ID );
     949            if (
     950                current_user_can( 'edit_post', $comment->comment_post_ID ) ||
     951                (
     952                    empty( $comment_post->post_password ) &&
     953                    current_user_can( 'read_post', $comment->comment_post_ID )
     954                )
     955            ) {
     956                _wp_dashboard_recent_comments_row( $comment );
     957            }
    949958        }
    950959        echo '</ul>';
Note: See TracChangeset for help on using the changeset viewer.