From 1b3f91f500dc3a6c2186babd76303979dcfa0156 Mon Sep 17 00:00:00 2001 From: Scott Taylor <scott.c.taylor@mac.com> Date: Sat, 10 Jan 2015 05:57:22 +0000 Subject: [PATCH] Declare `$wp_version`, `$required_php_version`, and `$required_mysql_version` as globals in install and upgrade admin files. See #30799. Built from https://develop.svn.wordpress.org/trunk@31124 git-svn-id: http://core.svn.wordpress.org/trunk@31105 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/update-core.php | 4 +++- wp-admin/install.php | 2 ++ wp-admin/options-general.php | 2 ++ wp-admin/upgrade.php | 2 ++ wp-includes/version.php | 2 +- 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php index 2189d55df9..8ae6c7f142 100644 --- a/wp-admin/includes/update-core.php +++ b/wp-admin/includes/update-core.php @@ -812,6 +812,8 @@ function update_core($from, $to) { // Import $wp_version, $required_php_version, and $required_mysql_version from the new version // $wp_filesystem->wp_content_dir() returned unslashed pre-2.8 + global $wp_version, $required_php_version, $required_mysql_version; + $versions_file = trailingslashit( $wp_filesystem->wp_content_dir() ) . 'upgrade/version-current.php'; if ( ! $wp_filesystem->copy( $from . $distro . 'wp-includes/version.php', $versions_file ) ) { $wp_filesystem->delete( $from, true ); @@ -824,7 +826,7 @@ function update_core($from, $to) { $php_version = phpversion(); $mysql_version = $wpdb->db_version(); - $old_wp_version = $GLOBALS['wp_version']; // The version of WordPress we're updating from + $old_wp_version = $wp_version; // The version of WordPress we're updating from $development_build = ( false !== strpos( $old_wp_version . $wp_version, '-' ) ); // a dash in the version indicates a Development release $php_compat = version_compare( $php_version, $required_php_version, '>=' ); if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) ) diff --git a/wp-admin/install.php b/wp-admin/install.php index 258162733f..66e3d2a7d7 100644 --- a/wp-admin/install.php +++ b/wp-admin/install.php @@ -159,6 +159,8 @@ if ( is_blog_installed() ) { die( '<h1>' . __( 'Already Installed' ) . '</h1><p>' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '</p><p class="step"><a href="../wp-login.php" class="button button-large">' . __( 'Log In' ) . '</a></p></body></html>' ); } +global $wp_version, $required_php_version, $required_mysql_version; + $php_version = phpversion(); $mysql_version = $wpdb->db_version(); $php_compat = version_compare( $php_version, $required_php_version, '>=' ); diff --git a/wp-admin/options-general.php b/wp-admin/options-general.php index 4de67e2a7b..960c4f0c26 100644 --- a/wp-admin/options-general.php +++ b/wp-admin/options-general.php @@ -319,6 +319,8 @@ if ( empty($tzstring) ) { // Create a UTC+- zone if no timezone string exists <th scope="row"><label for="start_of_week"><?php _e('Week Starts On') ?></label></th> <td><select name="start_of_week" id="start_of_week"> <?php +global $wp_locale; + for ($day_index = 0; $day_index <= 6; $day_index++) : $selected = (get_option('start_of_week') == $day_index) ? 'selected="selected"' : ''; echo "\n\t<option value='" . esc_attr($day_index) . "' $selected>" . $wp_locale->get_weekday($day_index) . '</option>'; diff --git a/wp-admin/upgrade.php b/wp-admin/upgrade.php index 57dedad94c..ece3eb056f 100644 --- a/wp-admin/upgrade.php +++ b/wp-admin/upgrade.php @@ -35,6 +35,8 @@ if ( 'upgrade_db' === $step ) { die( '0' ); } +global $wp_version, $required_php_version, $required_mysql_version; + $step = (int) $step; $php_version = phpversion(); diff --git a/wp-includes/version.php b/wp-includes/version.php index 6b6e07b5e5..bbf65fb84d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31123'; +$wp_version = '4.2-alpha-31124'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.