From 9b7feef7a91098d914dd91033c283015da10ade7 Mon Sep 17 00:00:00 2001 From: rob1n Date: Wed, 11 Apr 2007 03:23:23 +0000 Subject: [PATCH] Don't die because of output by badly-written plugins upon activation. Props masquerade. fixes #4127 git-svn-id: https://develop.svn.wordpress.org/trunk@5239 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/plugins.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index bcca0448bc..a01f43a072 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -12,11 +12,13 @@ if ( isset($_GET['action']) ) { 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 + ob_start(); @include(ABSPATH . PLUGINDIR . '/' . $plugin); $current[] = $plugin; sort($current); update_option('active_plugins', $current); do_action('activate_' . $plugin); + ob_end_clean(); } wp_redirect('plugins.php?activate=true'); // overrides the ?error=true one above } else if ('deactivate' == $_GET['action']) {