Don't die because of output by badly-written plugins upon activation. Props masquerade. fixes #4127

git-svn-id: http://svn.automattic.com/wordpress/trunk@5239 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rob1n 2007-04-11 03:23:23 +00:00
parent d40f03754d
commit ef58292639
1 changed files with 2 additions and 0 deletions

View File

@ -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']) {