Make WordPress Core


Ignore:
Timestamp:
10/12/2023 03:03:26 PM (11 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-admin/includes/ajax-actions.php

    r55774 r56875  
    38133813    $shortcode = wp_unslash( $_POST['shortcode'] );
    38143814
     3815    // Only process previews for media related shortcodes:
     3816    $found_shortcodes = get_shortcode_tags_in_content( $shortcode );
     3817    $media_shortcodes = array(
     3818        'audio',
     3819        'embed',
     3820        'playlist',
     3821        'video',
     3822        'gallery',
     3823    );
     3824
     3825    $other_shortcodes = array_diff( $found_shortcodes, $media_shortcodes );
     3826
     3827    if ( ! empty( $other_shortcodes ) ) {
     3828        wp_send_json_error();
     3829    }
     3830
    38153831    if ( ! empty( $_POST['post_ID'] ) ) {
    38163832        $post = get_post( (int) $_POST['post_ID'] );
     
    38193835    // The embed shortcode requires a post.
    38203836    if ( ! $post || ! current_user_can( 'edit_post', $post->ID ) ) {
    3821         if ( 'embed' === $shortcode ) {
     3837        if ( in_array( 'embed', $found_shortcodes, true ) ) {
    38223838            wp_send_json_error();
    38233839        }
Note: See TracChangeset for help on using the changeset viewer.