WordPress.org

Make WordPress Core

Changeset 25872


Ignore:
Timestamp:
10/22/2013 09:14:06 PM (7 years ago)
Author:
nacin
Message:

Show the nag we show for a stuck .maintenance file when an auto update failed.

see #25654.

File:
1 edited

Legend:

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

    r25835 r25872  
    345345
    346346function maintenance_nag() {
     347    include ABSPATH . WPINC . '/version.php'; // include an unmodified $wp_version
    347348    global $upgrading;
    348     if ( ! isset( $upgrading ) )
     349    $nag = isset( $upgrading );
     350    if ( ! $nag ) {
     351        $failed = get_site_option( 'auto_core_update_failed' );
     352        /*
     353         * If an update failed critically, we may have copied over version.php but not other files.
     354         * In that case, if the install claims we're running the version we attempted, nag.
     355         * This is serious enough to err on the side of nagging.
     356         *
     357         * If we simply failed to update before we tried to copy any files, then assume things are
     358         * OK if they are now running the latest.
     359         *
     360         * This flag is cleared whenever a successful update occurs using Core_Upgrader.
     361         */
     362        $comparison = ! empty( $failed['critical'] ) ? '>=' : '>';
     363        if ( version_compare( $failed['attempted'], $wp_version, '>=' ) )
     364            $nag = true;
     365    }
     366
     367    if ( ! $nag )
    349368        return false;
    350369
     
    357376}
    358377add_action( 'admin_notices', 'maintenance_nag' );
     378add_action( 'network_admin_notices', 'maintenance_nag' );
Note: See TracChangeset for help on using the changeset viewer.