From 7090cf8980a45292bcbf15546d2402310cd4fc34 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Tue, 14 Jul 2015 08:04:27 +0000 Subject: [PATCH] Updates: When performing an ajax plugin update, rely upon `wp_update_plugins()` to check the contents of the transient and return early if no request needs to be made. This works around a bug where custom update handlers are injecting an update into an empty transient, malforming the transient and causing update failures. Merges [33257] to the 4.2 branch. Fixes #32198 for 4.2 Built from https://develop.svn.wordpress.org/branches/4.2@33258 git-svn-id: http://core.svn.wordpress.org/branches/4.2@33230 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/ajax-actions.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index 40f8f5d195..2b5ec7fba5 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -2906,10 +2906,7 @@ function wp_ajax_update_plugin() { include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); - $current = get_site_transient( 'update_plugins' ); - if ( empty( $current ) ) { - wp_update_plugins(); - } + wp_update_plugins(); $upgrader = new Plugin_Upgrader( new Automatic_Upgrader_Skin() ); $result = $upgrader->bulk_upgrade( array( $plugin ) );