Make WordPress Core


Ignore:
Timestamp:
10/12/2023 02:54:10 PM (8 months ago)
Author:
joemcgill
Message:

Grouped backports to the 6.1 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.1 branch.
Props xknown, jorbin, Vortfu, joehoyle, timothyblynjacobs, peterwilsoncc, ehtis, tykoted, martinkrcho, paulkevan, dd32, antpb, rmccue.

Location:
branches/6.1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.1

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

    r55771 r56867  
    24542454        }
    24552455    } elseif ( ! empty( $atts['exclude'] ) ) {
     2456        $post_parent_id = $id;
    24562457        $attachments = get_children(
    24572458            array(
     
    24662467        );
    24672468    } else {
     2469        $post_parent_id = $id;
    24682470        $attachments = get_children(
    24692471            array(
     
    24762478            )
    24772479        );
     2480    }
     2481
     2482    if ( ! empty( $post_parent_id ) ) {
     2483        $post_parent = get_post( $post_parent_id );
     2484
     2485        // terminate the shortcode execution if user cannot read the post or password-protected
     2486        if (
     2487        ( ! is_post_publicly_viewable( $post_parent->ID ) && ! current_user_can( 'read_post', $post_parent->ID ) )
     2488        || post_password_required( $post_parent ) ) {
     2489            return '';
     2490        }
    24782491    }
    24792492
     
    28042817    }
    28052818
     2819    if ( ! empty( $args['post_parent'] ) ) {
     2820        $post_parent = get_post( $id );
     2821
     2822        // terminate the shortcode execution if user cannot read the post or password-protected
     2823        if ( ! current_user_can( 'read_post', $post_parent->ID ) || post_password_required( $post_parent ) ) {
     2824            return '';
     2825        }
     2826    }
     2827
    28062828    if ( empty( $attachments ) ) {
    28072829        return '';
Note: See TracChangeset for help on using the changeset viewer.