Make WordPress Core


Ignore:
Timestamp:
04/29/2020 04:13:02 PM (6 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], [47636], [47637], and [47638] to the 5.0 branch.

Props: aduth, batmoo, ehti, ellatrix, jorgefilipecosta, nickdaugherty, noisysocks, pento, peterwilsoncc, sergeybiryukov, sstoqnov, talldanwp, westi, westonruter, whyisjake, whyisjake, xknown.

Location:
branches/5.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0

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

    r43849 r47647  
    32043204    global $wpdb;
    32053205
     3206    // Capture original pre-sanitized array for passing into filters.
     3207    $unsanitized_postarr = $postarr;
     3208
    32063209    $user_id = get_current_user_id();
    32073210
     
    35073510         *
    35083511         * @since 3.9.0
     3512         * @since 5.4.1 `$unsanitized_postarr` argument added.
    35093513         *
    3510          * @param array $data    An array of sanitized attachment post data.
    3511          * @param array $postarr An array of unsanitized attachment post data.
     3514         * @param array $data                An array of slashed, sanitized, and processed attachment post data.
     3515         * @param array $postarr             An array of slashed and sanitized attachment post data, but not processed.
     3516         * @param array $unsanitized_postarr An array of slashed yet *unsanitized* and unprocessed attachment post data
     3517         *                                   as originally passed to wp_insert_post().
    35123518         */
    3513         $data = apply_filters( 'wp_insert_attachment_data', $data, $postarr );
     3519        $data = apply_filters( 'wp_insert_attachment_data', $data, $postarr, $unsanitized_postarr );
    35143520    } else {
    35153521        /**
     
    35173523         *
    35183524         * @since 2.7.0
     3525         * @since 5.4.1 `$unsanitized_postarr` argument added.
    35193526         *
    3520          * @param array $data    An array of slashed post data.
    3521          * @param array $postarr An array of sanitized, but otherwise unmodified post data.
     3527         * @param array $data                An array of slashed, sanitized, and processed post data.
     3528         * @param array $postarr             An array of sanitized (and slashed) but otherwise unmodified post data.
     3529         * @param array $unsanitized_postarr An array of slashed yet *unsanitized* and unprocessed post data as
     3530         *                                   originally passed to wp_insert_post().
    35223531         */
    3523         $data = apply_filters( 'wp_insert_post_data', $data, $postarr );
     3532        $data = apply_filters( 'wp_insert_post_data', $data, $postarr, $unsanitized_postarr );
    35243533    }
    35253534    $data = wp_unslash( $data );
Note: See TracChangeset for help on using the changeset viewer.