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.
Fixes #32198 for trunk


git-svn-id: https://develop.svn.wordpress.org/trunk@33257 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2015-07-14 08:00:31 +00:00
parent 65f5a16611
commit 56c51da216

View File

@ -2969,10 +2969,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();
$skin = new Automatic_Upgrader_Skin();
$upgrader = new Plugin_Upgrader( $skin );