Language Upgrader: Re-use the automatic upgrader skin if the parent upgrader is using it.

Prevents broken Ajax responses when `Language_Pack_Upgrader::async_upgrade()` gets triggered during a shiny update.

Fixes #34048.
Built from https://develop.svn.wordpress.org/trunk@34748


git-svn-id: http://core.svn.wordpress.org/trunk@34713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2015-10-01 20:25:26 +00:00
parent 99347fd96e
commit 113a9d4517
2 changed files with 10 additions and 5 deletions

View File

@ -1867,9 +1867,14 @@ class Language_Pack_Upgrader extends WP_Upgrader {
return;
}
$skin = new Language_Pack_Upgrader_Skin( array(
'skip_header_footer' => true,
) );
// Re-use the automatic upgrader skin if the parent upgrader is using it.
if ( $upgrader && $upgrader->skin instanceof Automatic_Upgrader_Skin ) {
$skin = $upgrader->skin;
} else {
$skin = new Language_Pack_Upgrader_Skin( array(
'skip_header_footer' => true,
) );
}
$lp_upgrader = new Language_Pack_Upgrader( $skin );
$lp_upgrader->bulk_upgrade( $language_updates );
@ -3368,7 +3373,7 @@ class WP_Automatic_Updater {
// Plugins, Themes, Translations
foreach ( array( 'plugin', 'theme', 'translation' ) as $type ) {
/**
* Filter to control whether a notification email is sent to the site admin email address for
* plugin, theme, and translation updates.

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-34747';
$wp_version = '4.4-alpha-34748';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.