Make WordPress Core


Ignore:
Timestamp:
10/12/2023 04:07:43 PM (3 years ago)
Author:
joemcgill
Message:

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

Location:
branches/6.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.2

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

    r55769 r56895  
    38563856        $shortcode = wp_unslash( $_POST['shortcode'] );
    38573857
     3858        // Only process previews for media related shortcodes:
     3859        $found_shortcodes = get_shortcode_tags_in_content( $shortcode );
     3860        $media_shortcodes = array(
     3861                'audio',
     3862                'embed',
     3863                'playlist',
     3864                'video',
     3865                'gallery',
     3866        );
     3867
     3868        $other_shortcodes = array_diff( $found_shortcodes, $media_shortcodes );
     3869
     3870        if ( ! empty( $other_shortcodes ) ) {
     3871                wp_send_json_error();
     3872        }
     3873
    38583874        if ( ! empty( $_POST['post_ID'] ) ) {
    38593875                $post = get_post( (int) $_POST['post_ID'] );
     
    38623878        // The embed shortcode requires a post.
    38633879        if ( ! $post || ! current_user_can( 'edit_post', $post->ID ) ) {
    3864                 if ( 'embed' === $shortcode ) {
     3880                if ( in_array( 'embed', $found_shortcodes, true ) ) {
    38653881                        wp_send_json_error();
    38663882                }
Note: See TracChangeset for help on using the changeset viewer.