From 3a4570b0fc8b3d6339bef71d17d7701554e0bbf7 Mon Sep 17 00:00:00 2001 From: donncha Date: Fri, 12 Oct 2007 16:21:15 +0000 Subject: Merge with WP 2.3 - testing use only! Move pluggable functions out of wpmu-functions and into pluggable.php, fixes #439 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1069 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-admin/plugins.php | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'wp-admin/plugins.php') diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index 885994b..d2c7d48 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -18,7 +18,7 @@ if ( isset($_GET['action']) ) { if ( ! file_exists(ABSPATH . PLUGINDIR . '/' . $plugin) ) wp_die(__('Plugin file does not exist.')); if (!in_array($plugin, $current)) { - wp_redirect('plugins.php?error=true'); // we'll override this later if the plugin can be included without fatal error + wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), 'plugins.php?error=true&plugin=' . $plugin)); // we'll override this later if the plugin can be included without fatal error ob_start(); @include(ABSPATH . PLUGINDIR . '/' . $plugin); $current[] = $plugin; @@ -28,7 +28,15 @@ if ( isset($_GET['action']) ) { ob_end_clean(); } wp_redirect('plugins.php?activate=true'); // overrides the ?error=true one above - } else if ('deactivate' == $_GET['action']) { + } elseif ('error_scrape' == $_GET['action']) { + $plugin = trim($_GET['plugin']); + check_admin_referer('plugin-activation-error_' . $plugin); + if ( validate_file($plugin) ) + wp_die(__('Invalid plugin.')); + if ( ! file_exists(ABSPATH . PLUGINDIR . '/' . $plugin) ) + wp_die(__('Plugin file does not exist.')); + include(ABSPATH . PLUGINDIR . '/' . $plugin); + } elseif ('deactivate' == $_GET['action']) { check_admin_referer('deactivate-plugin_' . $_GET['plugin']); $current = get_option('active_plugins'); array_splice($current, array_search( $_GET['plugin'], $current), 1 ); // Array-fu! @@ -38,12 +46,12 @@ if ( isset($_GET['action']) ) { } elseif ($_GET['action'] == 'deactivate-all') { check_admin_referer('deactivate-all'); $current = get_option('active_plugins'); - + foreach ($current as $plugin) { array_splice($current, array_search($plugin, $current), 1); do_action('deactivate_' . $plugin); } - + update_option('active_plugins', array()); wp_redirect('plugins.php?deactivate-all=true'); } @@ -80,7 +88,15 @@ foreach ($check_plugins as $check_plugin) { ?> -

fatal error.') ?>

+

fatal error.') ?>

+ + + +

activated.') ?>

@@ -142,7 +158,7 @@ if (empty($plugins)) { {$plugin_data['Title']} {$plugin_data['Version']} -

{$plugin_data['Description']} ".sprintf(__('By %s'), $plugin_data['Author']).".

+

{$plugin_data['Description']}$author

$toggle"; echo" "; -- cgit