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:
parent
d40f03754d
commit
ef58292639
|
@ -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