From d0e8e5ca35e41fa45251f17026342b8a991f6fd9 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 12 Jun 2012 15:31:25 +0000 Subject: [PATCH] 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 git-svn-id: https://develop.svn.wordpress.org/trunk@21062 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/class-wp-upgrader.php | 2 +- wp-admin/network/themes.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php index 112081f4f1..90b8336b8c 100644 --- a/wp-admin/includes/class-wp-upgrader.php +++ b/wp-admin/includes/class-wp-upgrader.php @@ -1521,7 +1521,7 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin { $install_actions['activate'] = '' . __('Activate') . ''; if ( is_network_admin() && current_user_can( 'manage_network_themes' ) ) - $install_actions['network_enable'] = '' . __( 'Network Enable' ) . ''; + $install_actions['network_enable'] = '' . __( 'Network Enable' ) . ''; if ( $this->type == 'web' ) $install_actions['themes_page'] = '' . __('Return to Theme Installer') . ''; diff --git a/wp-admin/network/themes.php b/wp-admin/network/themes.php index 5ca8145182..ba56a4a483 100644 --- a/wp-admin/network/themes.php +++ b/wp-admin/network/themes.php @@ -40,7 +40,10 @@ if ( $action ) { check_admin_referer('enable-theme_' . $_GET['theme']); $allowed_themes[ $_GET['theme'] ] = true; update_site_option( 'allowedthemes', $allowed_themes ); - wp_safe_redirect( add_query_arg( 'enabled', 1, $referer ) ); + if ( false === strpos( $referer, '/network/themes.php' ) ) + wp_redirect( network_admin_url( 'themes.php?enabled=1' ) ); + else + wp_safe_redirect( add_query_arg( 'enabled', 1, $referer ) ); exit; break; case 'disable':