From 3aed7560f6350ecbe5a9a64b4920ef84a07b07c8 Mon Sep 17 00:00:00 2001 From: nacin Date: Thu, 1 Dec 2011 05:03:11 +0000 Subject: [PATCH] Push logic into _redirect_to_about_wordpress() and be more specific about which context this runs under. see #18467. git-svn-id: http://svn.automattic.com/wordpress/trunk@19529 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/update-core.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php index 8b47fbd9d9..c2c2599906 100644 --- a/wp-admin/includes/update-core.php +++ b/wp-admin/includes/update-core.php @@ -536,6 +536,18 @@ function _copy_dir($from, $to, $skip_list = array() ) { * */ function _redirect_to_about_wordpress( $wp_version ) { + global $wp_version, $pagenow, $action; + + if ( version_compare( $wp_version, '3.3', '>=' ) ) + return; + + // Ensure we only run this on the update-core.php page. wp_update_core() could be called in other contexts. + if ( 'update-core.php' != $pagenow ) + return; + + if ( 'do-core-upgrade' != $action && 'do-core-reinstall' != $action ) + return; + // Load the updated default text localization domain for new strings load_default_textdomain(); @@ -554,5 +566,4 @@ window.location = ''; include(ABSPATH . 'wp-admin/admin-footer.php'); exit(); } -if ( version_compare( $GLOBALS['wp_version'], '3.3', '<' ) && 'update-core.php' == $GLOBALS['pagenow'] ) - add_action( '_core_updated_successfully', '_redirect_to_about_wordpress' ); +add_action( '_core_updated_successfully', '_redirect_to_about_wordpress' );