Ticket #18826: 18826.diff
File 18826.diff, 2.0 KB (added by , 11 years ago) |
---|
-
src/wp-admin/includes/class-wp-upgrader.php
347 347 if ( $enable ) { 348 348 $this->skin->feedback('maintenance_start'); 349 349 // Create maintenance file to signal that we are upgrading 350 $maintenance_string = '<?php $upgrading = ' . time() . '; ?>'; 350 $timeout = apply_filters( 'upgrader_maintenance_mode_timeout', 600 ); 351 $maintenance_string = '<?php $upgrading = ' . time() . '; $timeout = ' . intval( $timeout ) . '; ?>'; 351 352 $wp_filesystem->delete($file); 352 353 $wp_filesystem->put_contents($file, $maintenance_string, FS_CHMOD_FILE); 353 354 } else if ( !$enable && $wp_filesystem->exists($file) ) { -
src/wp-includes/load.php
145 145 if ( !file_exists( ABSPATH . '.maintenance' ) || defined( 'WP_INSTALLING' ) ) 146 146 return; 147 147 148 global $upgrading ;148 global $upgrading, $timeout; 149 149 150 150 include( ABSPATH . '.maintenance' ); 151 // If the $upgrading timestamp is older than 10 minutes, don't die. 152 if ( ( time() - $upgrading ) >= 600 ) 151 152 if ( empty( $timeout ) ) 153 $timeout = 600; // Default of Ten minutes maximum for maintenance mode, overridden in .maintenance 154 155 // If the $upgrading timestamp is older than $timeout seconds, don't die. 156 if ( ( time() - $upgrading ) >= $timeout ) 153 157 return; 154 158 155 159 if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) { … … 164 168 $protocol = 'HTTP/1.0'; 165 169 header( "$protocol 503 Service Unavailable", true, 503 ); 166 170 header( 'Content-Type: text/html; charset=utf-8' ); 167 header( 'Retry-After: 600');171 header( 'Retry-After: ' . $timeout ); 168 172 ?> 169 173 <!DOCTYPE html> 170 174 <html xmlns="http://www.w3.org/1999/xhtml"<?php if ( is_rtl() ) echo ' dir="rtl"'; ?>>