WordPress.org

Make WordPress Core

Ticket #35066: 35066.3.diff

File 35066.3.diff, 3.9 KB (added by chacha102, 4 years ago)
  • wp-admin/includes/class-wp-upgrader.php

    diff --git wp-admin/includes/class-wp-upgrader.php wp-admin/includes/class-wp-upgrader.php
    index d3abd8e..4327c07 100644
    class WP_Upgrader { 
    738738         */
    739739        public function maintenance_mode( $enable = false ) {
    740740                global $wp_filesystem;
    741                 $file = $wp_filesystem->abspath() . '.maintenance';
     741                $file = $wp_filesystem->abspath() . 'wordpress.maintenance';
    742742                if ( $enable ) {
    743743                        $this->skin->feedback('maintenance_start');
    744744                        // Create maintenance file to signal that we are upgrading
  • wp-admin/includes/update-core.php

    diff --git wp-admin/includes/update-core.php wp-admin/includes/update-core.php
    index 9f17a08..cc01e27 100644
    if ( ! defined( 'CORE_UPGRADE_SKIP_NEW_BUNDLED' ) || CORE_UPGRADE_SKIP_NEW_BUNDL 
    743743/**
    744744 * Upgrade the core of WordPress.
    745745 *
    746  * This will create a .maintenance file at the base of the WordPress directory
     746 * This will create a wordpress.maintenance file at the base of the WordPress directory
    747747 * to ensure that people can not access the web site, when the files are being
    748748 * copied to their locations.
    749749 *
    if ( ! defined( 'CORE_UPGRADE_SKIP_NEW_BUNDLED' ) || CORE_UPGRADE_SKIP_NEW_BUNDL 
    756756 * The steps for the upgrader for after the new release is downloaded and
    757757 * unzipped is:
    758758 *   1. Test unzipped location for select files to ensure that unzipped worked.
    759  *   2. Create the .maintenance file in current WordPress base.
     759 *   2. Create the wordpress.maintenance file in current WordPress base.
    760760 *   3. Copy new WordPress directory over old WordPress files.
    761761 *   4. Upgrade WordPress to new version.
    762762 *     4.1. Copy all files/folders other than wp-content
    763763 *     4.2. Copy any language files to WP_LANG_DIR (which may differ from WP_CONTENT_DIR
    764764 *     4.3. Copy any new bundled themes/plugins to their respective locations
    765765 *   5. Delete new WordPress directory path.
    766  *   6. Delete .maintenance file.
     766 *   6. Delete wordpress.maintenance file.
    767767 *   7. Remove old files.
    768768 *   8. Delete 'update_core' option.
    769769 *
    function update_core($from, $to) { 
    929929        apply_filters( 'update_feedback', __( 'Enabling Maintenance mode…' ) );
    930930        // Create maintenance file to signal that we are upgrading
    931931        $maintenance_string = '<?php $upgrading = ' . time() . '; ?>';
    932         $maintenance_file = $to . '.maintenance';
     932        $maintenance_file = $to . 'wordpress.maintenance';
    933933        $wp_filesystem->delete($maintenance_file);
    934934        $wp_filesystem->put_contents($maintenance_file, $maintenance_string, FS_CHMOD_FILE);
    935935
  • wp-includes/load.php

    diff --git wp-includes/load.php wp-includes/load.php
    index 9d247ba..2f3e987 100644
    function wp_favicon_request() { 
    160160/**
    161161 * Die with a maintenance message when conditions are met.
    162162 *
    163  * Checks for a file in the WordPress root directory named ".maintenance".
     163 * Checks for a file in the WordPress root directory named "wordpress.maintenance"
     164 * or '.maintenance' (deprecated).
     165 *
    164166 * This file will contain the variable $upgrading, set to the time the file
    165167 * was created. If the file was created less than 10 minutes ago, WordPress
    166168 * enters maintenance mode and displays a message.
    function wp_favicon_request() { 
    174176 * @global int $upgrading the unix timestamp marking when upgrading WordPress began.
    175177 */
    176178function wp_maintenance() {
    177         if ( ! file_exists( ABSPATH . '.maintenance' ) || wp_installing() )
     179        if ( ( ! file_exists( ABSPATH . 'wordpress.maintenance' ) && ! file_exists( ABSPATH . '.maintenance' ) ) || wp_installing() )
    178180                return;
    179181
    180182        global $upgrading;
     183        if ( file_exists( ABSPATH . 'wordpress.maintenance' ) ) {
     184                include ( ABSPATH . 'wordpress.maintenance' );
     185        } else {
     186                include ( ABSPATH . '.maintenance' );
     187        }
    181188
    182         include( ABSPATH . '.maintenance' );
    183189        // If the $upgrading timestamp is older than 10 minutes, don't die.
    184190        if ( ( time() - $upgrading ) >= 600 )
    185191                return;