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
This commit is contained in:
Dion Hulse 2015-07-14 08:04:27 +00:00
parent 63f64d5909
commit 7090cf8980
1 changed files with 1 additions and 4 deletions

View File

@ -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 ) );