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-admin/includes/ajax-actions.php

    r55771 r56867  
    38533853    $shortcode = wp_unslash( $_POST['shortcode'] );
    38543854
     3855    // Only process previews for media related shortcodes:
     3856    $found_shortcodes = get_shortcode_tags_in_content( $shortcode );
     3857    $media_shortcodes = array(
     3858        'audio',
     3859        'embed',
     3860        'playlist',
     3861        'video',
     3862        'gallery',
     3863    );
     3864
     3865    $other_shortcodes = array_diff( $found_shortcodes, $media_shortcodes );
     3866
     3867    if ( ! empty( $other_shortcodes ) ) {
     3868        wp_send_json_error();
     3869    }
     3870
    38553871    if ( ! empty( $_POST['post_ID'] ) ) {
    38563872        $post = get_post( (int) $_POST['post_ID'] );
     
    38593875    // The embed shortcode requires a post.
    38603876    if ( ! $post || ! current_user_can( 'edit_post', $post->ID ) ) {
    3861         if ( 'embed' === $shortcode ) {
     3877        if ( in_array( 'embed', $found_shortcodes, true ) ) {
    38623878            wp_send_json_error();
    38633879        }
Note: See TracChangeset for help on using the changeset viewer.