Make WordPress Core


Ignore:
Timestamp:
10/12/2023 04:07:43 PM (3 years ago)
Author:
joemcgill
Message:

Grouped backports to the 6.2 branch.

  • REST API: Limit search_columns for users without list_users.
  • Comments: Prevent users who can not see a post from seeing comments on it.
  • Application Passwords: Prevent the use of some pseudo protocols in application passwords.
  • Restrict media shortcode ajax to certain type
  • REST API: Ensure no-cache headers are sent when methods are overriden.
  • Prevent unintended behavior when certain objects are unserialized.

Merges [56833], [56834], [56835], [56836], [56837], and [56838] to the 6.2 branch.
Props xknown, jorbin, Vortfu, joehoyle, timothyblynjacobs, peterwilsoncc, ehtis, tykoted, martinkrcho, paulkevan, dd32, antpb, rmccue.

Location:
branches/6.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.2

  • branches/6.2/src/wp-includes/media.php

    r55769 r56895  
    24602460                }
    24612461        } elseif ( ! empty( $atts['exclude'] ) ) {
     2462                $post_parent_id = $id;
    24622463                $attachments = get_children(
    24632464                        array(
     
    24722473                );
    24732474        } else {
     2475                $post_parent_id = $id;
    24742476                $attachments = get_children(
    24752477                        array(
     
    24822484                        )
    24832485                );
     2486        }
     2487
     2488        if ( ! empty( $post_parent_id ) ) {
     2489                $post_parent = get_post( $post_parent_id );
     2490
     2491                // terminate the shortcode execution if user cannot read the post or password-protected
     2492                if (
     2493                ( ! is_post_publicly_viewable( $post_parent->ID ) && ! current_user_can( 'read_post', $post_parent->ID ) )
     2494                || post_password_required( $post_parent ) ) {
     2495                        return '';
     2496                }
    24842497        }
    24852498
     
    28162829        }
    28172830
     2831        if ( ! empty( $args['post_parent'] ) ) {
     2832                $post_parent = get_post( $id );
     2833
     2834                // terminate the shortcode execution if user cannot read the post or password-protected
     2835                if ( ! current_user_can( 'read_post', $post_parent->ID ) || post_password_required( $post_parent ) ) {
     2836                        return '';
     2837                }
     2838        }
     2839
    28182840        if ( empty( $attachments ) ) {
    28192841                return '';
Note: See TracChangeset for help on using the changeset viewer.