Make WordPress Core


Ignore:
Timestamp:
07/08/2014 05:14:20 PM (11 years ago)
Author:
helen
Message:

When accessing the Customizer from the admin menu, make sure the user is returned to the originating page upon close. We should still investigate the general usage of customize-loader.js moving forward, but this approach fixes the immediate issue. props westonruter. fixes #25457.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/customize.php

    r28861 r29026  
    1313require_once( dirname( __FILE__ ) . '/admin.php' );
    1414
    15 if ( ! current_user_can( 'edit_theme_options' ) )
     15if ( ! current_user_can( 'edit_theme_options' ) ) {
    1616    wp_die( __( 'Cheatin’ uh?' ) );
     17}
    1718
    1819wp_reset_vars( array( 'url', 'return' ) );
    19 $url = urldecode( $url );
     20$url = wp_unslash( $url );
    2021$url = wp_validate_redirect( $url, home_url( '/' ) );
    21 if ( $return )
    22     $return = wp_validate_redirect( urldecode( $return ) );
    23 if ( ! $return )
     22if ( $return ) {
     23    $return = wp_unslash( $return );
     24    $return = wp_validate_redirect( $return );
     25}
     26if ( ! $return ) {
    2427    $return = $url;
     28}
    2529
    2630global $wp_scripts, $wp_customize;
Note: See TracChangeset for help on using the changeset viewer.