Make WordPress Core


Ignore:
Timestamp:
04/29/2020 04:22:22 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.7 branch.

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

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

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

    r43395 r47650  
    29692969    global $wpdb;
    29702970
     2971    // Capture original pre-sanitized array for passing into filters.
     2972    $unsanitized_postarr = $postarr;
     2973
    29712974    $user_id = get_current_user_id();
    29722975
     
    32653268         *
    32663269         * @since 3.9.0
     3270         * @since 5.4.1 `$unsanitized_postarr` argument added.
    32673271         *
    3268          * @param array $data    An array of sanitized attachment post data.
    3269          * @param array $postarr An array of unsanitized attachment post data.
     3272         * @param array $data                An array of slashed, sanitized, and processed attachment post data.
     3273         * @param array $postarr             An array of slashed and sanitized attachment post data, but not processed.
     3274         * @param array $unsanitized_postarr An array of slashed yet *unsanitized* and unprocessed attachment post data
     3275         *                                   as originally passed to wp_insert_post().
    32703276         */
    3271         $data = apply_filters( 'wp_insert_attachment_data', $data, $postarr );
     3277        $data = apply_filters( 'wp_insert_attachment_data', $data, $postarr, $unsanitized_postarr );
    32723278    } else {
    32733279        /**
     
    32753281         *
    32763282         * @since 2.7.0
     3283         * @since 5.4.1 `$unsanitized_postarr` argument added.
    32773284         *
    3278          * @param array $data    An array of slashed post data.
    3279          * @param array $postarr An array of sanitized, but otherwise unmodified post data.
     3285         * @param array $data                An array of slashed, sanitized, and processed post data.
     3286         * @param array $postarr             An array of sanitized (and slashed) but otherwise unmodified post data.
     3287         * @param array $unsanitized_postarr An array of slashed yet *unsanitized* and unprocessed post data as
     3288         *                                   originally passed to wp_insert_post().
    32803289         */
    3281         $data = apply_filters( 'wp_insert_post_data', $data, $postarr );
     3290        $data = apply_filters( 'wp_insert_post_data', $data, $postarr, $unsanitized_postarr );
    32823291    }
    32833292    $data = wp_unslash( $data );
Note: See TracChangeset for help on using the changeset viewer.