WordPress.org

Make WordPress Core

Changeset 34748


Ignore:
Timestamp:
10/01/2015 08:24:18 PM (4 years ago)
Author:
ocean90
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-upgrader.php

    r34717 r34748  
    18681868        }
    18691869
    1870         $skin = new Language_Pack_Upgrader_Skin( array(
    1871             'skip_header_footer' => true,
    1872         ) );
     1870        // Re-use the automatic upgrader skin if the parent upgrader is using it.
     1871        if ( $upgrader && $upgrader->skin instanceof Automatic_Upgrader_Skin ) {
     1872            $skin = $upgrader->skin;
     1873        } else {
     1874            $skin = new Language_Pack_Upgrader_Skin( array(
     1875                'skip_header_footer' => true,
     1876            ) );
     1877        }
    18731878
    18741879        $lp_upgrader = new Language_Pack_Upgrader( $skin );
     
    33693374        // Plugins, Themes, Translations
    33703375        foreach ( array( 'plugin', 'theme', 'translation' ) as $type ) {
    3371            
     3376
    33723377            /**
    33733378             * Filter to control whether a notification email is sent to the site admin email address for
Note: See TracChangeset for help on using the changeset viewer.