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
This commit is contained in:
parent
9dcdbbd7ae
commit
9b7feef7a9
@ -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']) {
|
||||
|
Loading…
Reference in New Issue
Block a user