Make WordPress Core

Ticket #32692: 32692.2.diff

File 32692.2.diff, 2.4 KB (added by swissspidy, 9 years ago)
  • src/wp-admin/customize.php

    diff --git src/wp-admin/customize.php src/wp-admin/customize.php
    index 6ee2de0..bfc9623 100644
    $url = wp_unslash( $url ); 
    2121$url = wp_validate_redirect( $url, home_url( '/' ) );
    2222if ( $return ) {
    2323        $return = wp_unslash( $return );
     24        $return = remove_query_arg( wp_removable_query_args(), $return );
    2425        $return = wp_validate_redirect( $return );
    2526}
    2627if ( ! $return ) {
  • src/wp-admin/includes/misc.php

    diff --git src/wp-admin/includes/misc.php src/wp-admin/includes/misc.php
    index 83e7548..d65d22b 100644
    function post_form_autocomplete_off() { 
    865865 * @since 4.2.0
    866866 */
    867867function wp_admin_canonical_url() {
    868         $removable_query_args = array(
    869                 'message', 'settings-updated', 'saved',
    870                 'update', 'updated', 'activated',
    871                 'activate', 'deactivate', 'locked',
    872                 'deleted', 'trashed', 'untrashed',
    873                 'enabled', 'disabled', 'skipped',
    874                 'spammed', 'unspammed',
    875                 'error',
    876         );
    877 
    878         /**
    879          * Filter the list of URL parameters to remove.
    880          *
    881          * @since 4.2.0
    882          *
    883          * @param array $removable_query_args An array of parameters to remove from the URL.
    884          */
    885         $removable_query_args = apply_filters( 'removable_query_args', $removable_query_args );
     868        $removable_query_args = wp_removable_query_args();
    886869
    887870        if ( empty( $removable_query_args ) ) {
    888871                return;
  • src/wp-includes/functions.php

    diff --git src/wp-includes/functions.php src/wp-includes/functions.php
    index 006cb6c..f18c86a 100644
    function remove_query_arg( $key, $query = false ) { 
    825825}
    826826
    827827/**
     828 * Returns the list of URL parameters to remove.
     829 *
     830 * @since 4.4.0
     831 *
     832 * @return array An array of parameters to remove from the URL.
     833 */
     834function wp_removable_query_args() {
     835        $removable_query_args = array(
     836                'message', 'settings-updated', 'saved',
     837                'update', 'updated', 'activated',
     838                'activate', 'deactivate', 'locked',
     839                'deleted', 'trashed', 'untrashed',
     840                'enabled', 'disabled', 'skipped',
     841                'spammed', 'unspammed',
     842        );
     843
     844        /**
     845         * Filter the list of URL parameters to remove.
     846         *
     847         * @since 4.2.0
     848         *
     849         * @param array $removable_query_args An array of parameters to remove from the URL.
     850         */
     851        return apply_filters( 'removable_query_args', $removable_query_args );
     852}
     853
     854/**
    828855 * Walks the array while sanitizing the contents.
    829856 *
    830857 * @since 0.71