WordPress.org

Make WordPress Core

Ticket #35066: 35066.2.diff

File 35066.2.diff, 1.4 KB (added by chacha102, 4 years ago)
  • 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;