diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index c7a645442..2b8f2dfb2 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -32,10 +32,10 @@ if ( $action ) { check_admin_referer('activate-plugin_' . $plugin); - $result = activate_plugin($plugin, 'plugins.php?error=true&plugin=' . $plugin, $network_wide); + $result = activate_plugin($plugin, admin_url('plugins.php?error=true&plugin=' . $plugin), $network_wide); if ( is_wp_error( $result ) ) { if ( 'unexpected_output' == $result->get_error_code() ) { - $redirect = 'plugins.php?error=true&charsout=' . strlen($result->get_error_data()) . '&plugin=' . $plugin . "&plugin_status=$status&paged=$page&s=$s"; + $redirect = admin_url('plugins.php?error=true&charsout=' . strlen($result->get_error_data()) . '&plugin=' . $plugin . "&plugin_status=$status&paged=$page&s=$s"); wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect)); exit; } else { @@ -49,9 +49,9 @@ if ( $action ) { update_option('recently_activated', $recent); } if ( isset($_GET['from']) && 'import' == $_GET['from'] ) { - wp_redirect("import.php?import=" . str_replace('-importer', '', dirname($plugin)) ); // overrides the ?error=true one above and redirects to the Imports page, striping the -importer suffix + wp_redirect( admin_url("import.php?import=" . str_replace('-importer', '', dirname($plugin))) ); // overrides the ?error=true one above and redirects to the Imports page, striping the -importer suffix } else { - wp_redirect("plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s"); // overrides the ?error=true one above + wp_redirect( admin_url("plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s") ); // overrides the ?error=true one above } exit; break; @@ -65,11 +65,11 @@ if ( $action ) { $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array(); $plugins = array_filter($plugins, create_function('$plugin', 'return !is_plugin_active($plugin);') ); // Only activate plugins which are not already active. if ( empty($plugins) ) { - wp_redirect("plugins.php?plugin_status=$status&paged=$page&s=$s"); + wp_redirect( admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") ); exit; } - activate_plugins($plugins, 'plugins.php?error=true', $network_wide); + activate_plugins($plugins, admin_url('plugins.php?error=true'), $network_wide); $recent = (array)get_option('recently_activated'); foreach ( $plugins as $plugin => $time) @@ -78,7 +78,7 @@ if ( $action ) { update_option('recently_activated', $recent); - wp_redirect("plugins.php?activate-multi=true&plugin_status=$status&paged=$page&s=$s"); + wp_redirect( admin_url("plugins.php?activate-multi=true&plugin_status=$status&paged=$page&s=$s") ); exit; break; case 'update-selected' : @@ -102,7 +102,7 @@ if ( $action ) { echo '