From 03ad31aff225ab4fc8efddab45a50f6f7522e1b5 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 10 Dec 2008 07:59:05 +0000 Subject: [PATCH] Fix reinstall git-svn-id: https://develop.svn.wordpress.org/trunk@10166 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/update-core.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/wp-admin/update-core.php b/wp-admin/update-core.php index c388f43616..ff327006e6 100644 --- a/wp-admin/update-core.php +++ b/wp-admin/update-core.php @@ -19,6 +19,7 @@ function list_core_update( $update ) { if ( !isset($update->response) || 'latest' == $update->response ) $current = true; $submit = __('Upgrade Automatically'); + $form_action = 'update-core.php?action=do-core-upgrade'; if ( 'development' == $update->response ) { $message = __('You are using a development version of WordPress. You can upgrade to the latest nightly build automatically or download the nightly build and install it manually:'); $download = __('Download nightly build'); @@ -26,6 +27,7 @@ function list_core_update( $update ) { if ( $current ) { $message = sprintf(__('You have the latest version of WordPress. You do not need to upgrade. However, if you want to re-install version %s, you can do so automatically or download the package and re-install manually:'), $version_string); $submit = __('Re-install Automatically'); + $form_action = 'update-core.php?action=do-core-reinstall'; } else { $message = sprintf(__('You can upgrade to version %s automatically or download the package and install it manually:'), $version_string); } @@ -35,7 +37,7 @@ function list_core_update( $update ) { echo '

'; echo $message; echo '

'; - echo '
'; + echo ''; wp_nonce_field('upgrade-core'); echo '

'; echo ' '; @@ -129,7 +131,7 @@ function core_upgrade_preamble() { * * @return null */ -function do_core_upgrade() { +function do_core_upgrade( $reinstall = false ) { global $wp_filesystem; $url = wp_nonce_url('update-core.php?action=do-core-upgrade', 'upgrade-core'); @@ -159,6 +161,9 @@ function do_core_upgrade() { return; } + if ( $reinstall ) + $update->response = 'reinstall'; + $result = wp_update_core($update, 'show_message'); if ( is_wp_error($result) ) { @@ -199,7 +204,7 @@ if ( 'upgrade-core' == $action ) { require_once('admin-header.php'); core_upgrade_preamble(); include('admin-footer.php'); -} elseif ( 'do-core-upgrade' == $action ) { +} elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) { check_admin_referer('upgrade-core'); $title = __('Upgrade WordPress'); $parent_file = 'tools.php'; @@ -210,7 +215,12 @@ if ( 'upgrade-core' == $action ) { elseif ( isset( $_POST['undismiss'] ) ) do_undismiss_core_update(); require_once('admin-header.php'); + if ( 'do-core-reinstall' == $action ) + $reinstall = true; + else + $reinstall = false; if ( isset( $_POST['upgrade'] ) ) - do_core_upgrade(); + do_core_upgrade($reinstall); include('admin-footer.php'); + }?>