Make WordPress Core


Ignore:
Timestamp:
10/12/2023 03:03:26 PM (9 months ago)
Author:
joemcgill
Message:

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

Location:
branches/5.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.9

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

    r55774 r56875  
    23552355        }
    23562356    } elseif ( ! empty( $atts['exclude'] ) ) {
     2357        $post_parent_id = $id;
    23572358        $attachments = get_children(
    23582359            array(
     
    23672368        );
    23682369    } else {
     2370        $post_parent_id = $id;
    23692371        $attachments = get_children(
    23702372            array(
     
    23772379            )
    23782380        );
     2381    }
     2382
     2383    if ( ! empty( $post_parent_id ) ) {
     2384        $post_parent = get_post( $post_parent_id );
     2385
     2386        // terminate the shortcode execution if user cannot read the post or password-protected
     2387        if (
     2388        ( ! is_post_publicly_viewable( $post_parent->ID ) && ! current_user_can( 'read_post', $post_parent->ID ) )
     2389        || post_password_required( $post_parent ) ) {
     2390            return '';
     2391        }
    23792392    }
    23802393
     
    27052718    }
    27062719
     2720    if ( ! empty( $args['post_parent'] ) ) {
     2721        $post_parent = get_post( $id );
     2722
     2723        // terminate the shortcode execution if user cannot read the post or password-protected
     2724        if ( ! current_user_can( 'read_post', $post_parent->ID ) || post_password_required( $post_parent ) ) {
     2725            return '';
     2726        }
     2727    }
     2728
    27072729    if ( empty( $attachments ) ) {
    27082730        return '';
Note: See TracChangeset for help on using the changeset viewer.