Make WordPress Core


Ignore:
Timestamp:
08/17/2013 05:35:17 AM (11 years ago)
Author:
dd32
Message:

WP_Upgrader: Don't activate maintenance mode in bulk_upgrade() when no Themes or Plugins are specified. This doesn't affect Core, but rather, plugins who use the upgrade routines and do not do precautionary tests. Props jamescollins. Fixes #24496

File:
1 edited

Legend:

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

    r24474 r25048  
    488488        $this->skin->bulk_header();
    489489
    490         // Only start maintenance mode if running in Multisite OR the plugin is in use
    491         $maintenance = is_multisite(); // @TODO: This should only kick in for individual sites if at all possible.
     490        // Only start maintenance mode if:
     491        // - running Multisite and there are one or more plugins specified, OR
     492        // - a plugin with an update available is currently active.
     493        // @TODO: For multisite, maintenance mode should only kick in for individual sites if at all possible.
     494        $maintenance = ( is_multisite() && ! empty( $plugins ) );
    492495        foreach ( $plugins as $plugin )
    493             $maintenance = $maintenance || (is_plugin_active($plugin) && isset($current->response[ $plugin ]) ); // Only activate Maintenance mode if a plugin is active AND has an update available
     496            $maintenance = $maintenance || ( is_plugin_active( $plugin ) && isset( $current->response[ $plugin] ) );
    494497        if ( $maintenance )
    495498            $this->maintenance_mode(true);
     
    849852        $this->skin->bulk_header();
    850853
    851         // Only start maintenance mode if running in Multisite OR the theme is in use
    852         $maintenance = is_multisite(); // @TODO: This should only kick in for individual sites if at all possible.
     854        // Only start maintenance mode if:
     855        // - running Multisite and there are one or more themes specified, OR
     856        // - a theme with an update available is currently in use.
     857        // @TODO: For multisite, maintenance mode should only kick in for individual sites if at all possible.
     858        $maintenance = ( is_multisite() && ! empty( $themes ) );
    853859        foreach ( $themes as $theme )
    854860            $maintenance = $maintenance || $theme == get_stylesheet() || $theme == get_template();
Note: See TracChangeset for help on using the changeset viewer.