diff --git a/wp-admin/includes/plugin.php b/wp-admin/includes/plugin.php index 7cc04ffc03..be3f523039 100644 --- a/wp-admin/includes/plugin.php +++ b/wp-admin/includes/plugin.php @@ -119,7 +119,8 @@ function deactivate_plugins($plugins) { $item = array_search( $plugin, $current); if( false === $item) continue; - array_splice($current, $item, 1 ); // Array-fu! + if ( ( $key = array_search( $plugin, $current) ) !== false ) + array_splice($current, $key, 1 ); // Fixed Array-fu! do_action('deactivate_' . trim( $plugin )); } diff --git a/wp-admin/plugin-editor.php b/wp-admin/plugin-editor.php index ab46c82dfb..3c786ce081 100644 --- a/wp-admin/plugin-editor.php +++ b/wp-admin/plugin-editor.php @@ -40,7 +40,8 @@ case 'update': $current = get_option('active_plugins'); if ( in_array($file, $current) || isset($_POST['phperror']) ) { if ( in_array($file, $current) ) { - array_splice($current, array_search( $file, $current), 1 ); // Array-fu! + if ( ( $key = array_search( $plugin, $current) ) !== false ) + array_splice($current, $key, 1 ); // Fixed Array-fu! update_option('active_plugins', $current); } wp_redirect(add_query_arg('_wpnonce', wp_create_nonce('edit-plugin-test_' . $file), "plugin-editor.php?file=$file&liveupdate=1"));