Make WordPress Core


Ignore:
Timestamp:
10/12/2023 02:59:28 PM (3 years ago)
Author:
davidbaumwald
Message:

Grouped backports to the 5.0 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.0 branch.
Props xknown, jorbin, joehoyle, timothyblynjacobs, peterwilsoncc, ehtis, tykoted, antpb, rmccue.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php

    r43737 r56871  
    272272
    273273        if ( ! empty( $prepared_args['search'] ) ) {
     274            if ( ! current_user_can( 'list_users' ) ) {
     275                $prepared_args['search_columns'] = array( 'ID', 'user_login', 'user_nicename', 'display_name' );
     276            }
    274277            $prepared_args['search'] = '*' . $prepared_args['search'] . '*';
    275278        }
Note: See TracChangeset for help on using the changeset viewer.