WordPress.org

Make WordPress Core

Changeset 21062


Ignore:
Timestamp:
06/12/12 15:31:25 (3 years ago)
Author:
ryan
Message:

Use the stylesheet rather than the template to create the network enable theme nonce. Fix network enable redirect following theme installation. Props duck_, nacin. fixes #20916

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-upgrader.php

    r21061 r21062  
    15221522 
    15231523        if ( is_network_admin() && current_user_can( 'manage_network_themes' ) ) 
    1524             $install_actions['network_enable'] = '<a href="' . esc_url( wp_nonce_url( 'themes.php?action=enable&amp;theme=' . $template, 'enable-theme_' . $template ) ) . '" title="' . esc_attr__( 'Enable this theme for all sites in this network' ) . '" target="_parent">' . __( 'Network Enable' ) . '</a>'; 
     1524            $install_actions['network_enable'] = '<a href="' . esc_url( wp_nonce_url( 'themes.php?action=enable&amp;theme=' . $stylesheet, 'enable-theme_' . $stylesheet ) ) . '" title="' . esc_attr__( 'Enable this theme for all sites in this network' ) . '" target="_parent">' . __( 'Network Enable' ) . '</a>'; 
    15251525 
    15261526        if ( $this->type == 'web' ) 
  • trunk/wp-admin/network/themes.php

    r20151 r21062  
    4141            $allowed_themes[ $_GET['theme'] ] = true; 
    4242            update_site_option( 'allowedthemes', $allowed_themes ); 
    43             wp_safe_redirect( add_query_arg( 'enabled', 1, $referer ) ); 
     43            if ( false === strpos( $referer, '/network/themes.php' ) ) 
     44                wp_redirect( network_admin_url( 'themes.php?enabled=1' ) ); 
     45            else 
     46                wp_safe_redirect( add_query_arg( 'enabled', 1, $referer ) ); 
    4447            exit; 
    4548            break; 
Note: See TracChangeset for help on using the changeset viewer.