Make WordPress Core

Changeset 56846

Timestamp:
10/12/2023 01:27:29 PM (10 months ago)
Author:
audrasjb
Message:

Shortcodes: Restrict ajax handler for media shortcode.

Props tykoted, xknown, peterwilsoncc, antpb, jorbin.
Merges [56838] to the 6.3 branch.

Location:
branches/6.3
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/6.3

  • branches/6.3/src/wp-admin/includes/ajax-actions.php

    r56245 r56846  
    38833883    $shortcode = wp_unslash( $_POST['shortcode'] );
    38843884
     3885
     3886
     3887
     3888
     3889
     3890
     3891
     3892
     3893
     3894
     3895
     3896
     3897
     3898
     3899
     3900
    38853901    if ( ! empty( $_POST['post_ID'] ) ) {
    38863902        $post = get_post( (int) $_POST['post_ID'] );
     
    38893905    // The embed shortcode requires a post.
    38903906    if ( ! $post || ! current_user_can( 'edit_post', $post->ID ) ) {
    3891         if ( 'embed' === $shortcode ) {
     3907        if ( ) {
    38923908            wp_send_json_error();
    38933909        }
  • branches/6.3/src/wp-includes/media.php

    r56429 r56846  
    26062606        }
    26072607    } elseif ( ! empty( $atts['exclude'] ) ) {
     2608
    26082609        $attachments = get_children(
    26092610            array(
     
    26182619        );
    26192620    } else {
     2621
    26202622        $attachments = get_children(
    26212623            array(
     
    26282630            )
    26292631        );
     2632
     2633
     2634
     2635
     2636
     2637
     2638
     2639
     2640
     2641
     2642
    26302643    }
    26312644
     
    29622975    }
    29632976
     2977
     2978
     2979
     2980
     2981
     2982
     2983
     2984
     2985
    29642986    if ( empty( $attachments ) ) {
    29652987        return '';
  • branches/6.3/src/wp-includes/shortcodes.php

    r56214 r56846  
    167167    }
    168168    return false;
     169
     170
     171
     172
     173
     174
     175
     176
     177
     178
     179
     180
     181
     182
     183
     184
     185
     186
     187
     188
     189
     190
     191
     192
     193
     194
     195
     196
     197
     198
     199
     200
     201
     202
     203
     204
     205
     206
    169207}
    170208
Note: See TracChangeset for help on using the changeset viewer.