From c209f15b5cf8bd6266dc7158a70f9a8199be7f0c Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 5 Oct 2008 05:45:34 +0000 Subject: [PATCH] Don't die with 503 if WP_INSTALLING. Don't load plugins if WP_INSTALLING. Remove old files and working dir before exiting maintenance mode. see #5560 git-svn-id: http://svn.automattic.com/wordpress/trunk@9085 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/update-core.php | 14 +++++++------- wp-settings.php | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php index 7cb975da1..e4e47f9d9 100644 --- a/wp-admin/includes/update-core.php +++ b/wp-admin/includes/update-core.php @@ -199,17 +199,11 @@ function update_core($from, $to) { return $result; } - // Might have to do upgrade in a separate step. + // Upgrade DB with separate request apply_filters('update_feedback', __('Upgrading database')); $db_upgrade_url = admin_url('upgrade.php?step=upgrade_db'); wp_remote_post($db_upgrade_url, array('timeout' => 60)); - // Remove working directory - $wp_filesystem->delete($from, true); - - // Remove maintenance file, we're done. - $wp_filesystem->delete($maintenance_file); - // Remove old files foreach ( $_old_files as $old_file ) { $old_file = $to . $old_file; @@ -218,8 +212,14 @@ function update_core($from, $to) { $wp_filesystem->delete($old_file, true); } + // Remove working directory + $wp_filesystem->delete($from, true); + // Force refresh of update information delete_option('update_core'); + + // Remove maintenance file, we're done. + $wp_filesystem->delete($maintenance_file); } ?> \ No newline at end of file diff --git a/wp-settings.php b/wp-settings.php index 4ce8437e1..e703202fb 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -107,7 +107,7 @@ if ( version_compare( '4.3', phpversion(), '>' ) ) { if ( !defined('WP_CONTENT_DIR') ) define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // no trailing slash, full paths only - WP_CONTENT_URL is defined further down -if ( file_exists(ABSPATH . '.maintenance') ) { +if ( file_exists(ABSPATH . '.maintenance') && !defined('WP_INSTALLING') ) { if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) { require_once( WP_CONTENT_DIR . '/maintenance.php' ); die(); @@ -445,7 +445,7 @@ if (get_option('hack_file')) { require(ABSPATH . 'my-hacks.php'); } -if ( get_option('active_plugins') ) { +if ( get_option('active_plugins') && !defined('WP_INSTALLING') ) { $current_plugins = get_option('active_plugins'); if ( is_array($current_plugins) ) { foreach ($current_plugins as $plugin) {