Push logic into _redirect_to_about_wordpress() and be more specific about which context this runs under. see #18467.

git-svn-id: https://develop.svn.wordpress.org/trunk@19529 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2011-12-01 05:03:11 +00:00
parent 6610e321e7
commit 2d82fa2b5a
1 changed files with 13 additions and 2 deletions

View File

@ -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 = '<?php echo admin_url( 'about.php?updated' ); ?>';
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' );