Make WordPress Core


Ignore:
Timestamp:
04/29/2020 04:18:07 PM (5 years ago)
Author:
whyisjake
Message:

Customize: Add additional filters to Customizer to prevent JSON corruption.
User: Invalidate user_activation_key on password update.
Query: Ensure that only a single post can be returned on date/time based queries.
Cache API: Ensure proper escaping around the stats method in the cache API.
Formatting: Expand sanitize_file_name to have better support for utf8 characters.

Brings the changes in [47633], [47634], [47635], [47637], and [47638] to the 4.8 branch.

Props: batmoo, ehti, nickdaugherty, peterwilsoncc, sergeybiryukov, sstoqnov, westi, westonruter, whyisjake, whyisjake, xknown.

Location:
branches/4.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.8

  • branches/4.8/src/wp-includes/post.php

    r43394 r47649  
    29742974    global $wpdb;
    29752975
     2976    // Capture original pre-sanitized array for passing into filters.
     2977    $unsanitized_postarr = $postarr;
     2978
    29762979    $user_id = get_current_user_id();
    29772980
     
    32703273         *
    32713274         * @since 3.9.0
     3275         * @since 5.4.1 `$unsanitized_postarr` argument added.
    32723276         *
    3273          * @param array $data    An array of sanitized attachment post data.
    3274          * @param array $postarr An array of unsanitized attachment post data.
     3277         * @param array $data                An array of slashed, sanitized, and processed attachment post data.
     3278         * @param array $postarr             An array of slashed and sanitized attachment post data, but not processed.
     3279         * @param array $unsanitized_postarr An array of slashed yet *unsanitized* and unprocessed attachment post data
     3280         *                                   as originally passed to wp_insert_post().
    32753281         */
    3276         $data = apply_filters( 'wp_insert_attachment_data', $data, $postarr );
     3282        $data = apply_filters( 'wp_insert_attachment_data', $data, $postarr, $unsanitized_postarr );
    32773283    } else {
    32783284        /**
     
    32803286         *
    32813287         * @since 2.7.0
     3288         * @since 5.4.1 `$unsanitized_postarr` argument added.
    32823289         *
    3283          * @param array $data    An array of slashed post data.
    3284          * @param array $postarr An array of sanitized, but otherwise unmodified post data.
     3290         * @param array $data                An array of slashed, sanitized, and processed post data.
     3291         * @param array $postarr             An array of sanitized (and slashed) but otherwise unmodified post data.
     3292         * @param array $unsanitized_postarr An array of slashed yet *unsanitized* and unprocessed post data as
     3293         *                                   originally passed to wp_insert_post().
    32853294         */
    3286         $data = apply_filters( 'wp_insert_post_data', $data, $postarr );
     3295        $data = apply_filters( 'wp_insert_post_data', $data, $postarr, $unsanitized_postarr );
    32873296    }
    32883297    $data = wp_unslash( $data );
Note: See TracChangeset for help on using the changeset viewer.