Changeset 12523
- Timestamp:
- 12/23/2009 06:35:12 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/update-core.php
r12497 r12523 14 14 15 15 function list_core_update( $update ) { 16 global $wp_local_package ;16 global $wp_local_package, $wpdb; 17 17 $version_string = ('en_US' == $update->locale && 'en_US' == get_locale() ) ? 18 18 $update->current : sprintf("%s–<strong>%s</strong>", $update->current, $update->locale); … … 22 22 $submit = __('Upgrade Automatically'); 23 23 $form_action = 'update-core.php?action=do-core-upgrade'; 24 $php_version = phpversion(); 25 $mysql_version = $wpdb->db_version(); 26 $show_buttons = true; 24 27 if ( 'development' == $update->response ) { 25 28 $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:'); … … 31 34 $form_action = 'update-core.php?action=do-core-reinstall'; 32 35 } else { 33 $message = sprintf(__('You can upgrade to version %s automatically or download the package and install it manually:'), $version_string); 36 $php_compat = version_compare( $php_version, $update->php_version, '>=' ); 37 $mysql_compat = version_compare( $mysql_version, $update->mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' ); 38 if ( !$mysql_compat && !$php_compat ) 39 $message = sprintf( __('You cannot upgrade because WordPress %1$s requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.'), $update->current, $update->php_version, $update->mysql_version, $php_version, $mysql_version ); 40 elseif ( !$php_compat ) 41 $message = sprintf( __('You cannot upgrade because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.'), $update->current, $update->php_version, $php_version ); 42 elseif ( !$mysql_compat ) 43 $message = sprintf( __('You cannot upgrade because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.'), $update->current, $update->mysql_version, $mysql_version ); 44 else 45 $message = sprintf(__('You can upgrade to version %s automatically or download the package and install it manually:'), $version_string); 46 if ( !$mysql_compat || !$php_compat ) 47 $show_buttons = false; 34 48 } 35 49 $download = sprintf(__('Download %s'), $version_string); … … 42 56 wp_nonce_field('upgrade-core'); 43 57 echo '<p>'; 44 echo '<input id="upgrade" class="button" type="submit" value="' . esc_attr($submit) . '" name="upgrade" /> ';45 58 echo '<input name="version" value="'. esc_attr($update->current) .'" type="hidden"/>'; 46 59 echo '<input name="locale" value="'. esc_attr($update->locale) .'" type="hidden"/>'; 47 echo '<a href="' . esc_url($update->package) . '" class="button">' . $download . '</a> '; 60 if ( $show_buttons ) { 61 echo '<input id="upgrade" class="button" type="submit" value="' . esc_attr($submit) . '" name="upgrade" /> '; 62 echo '<a href="' . esc_url($update->package) . '" class="button">' . $download . '</a> '; 63 } 48 64 if ( 'en_US' != $update->locale ) 49 65 if ( !isset( $update->dismissed ) || !$update->dismissed ) -
trunk/wp-includes/update.php
r12348 r12523 45 45 $mysql_version = 'N/A'; 46 46 $local_package = isset( $wp_local_package )? $wp_local_package : ''; 47 $url = "http://api.wordpress.org/core/version-check/1. 3/?version=$wp_version&php=$php_version&locale=$locale&mysql=$mysql_version&local_package=$local_package";47 $url = "http://api.wordpress.org/core/version-check/1.4/?version=$wp_version&php=$php_version&locale=$locale&mysql=$mysql_version&local_package=$local_package"; 48 48 49 49 $options = array( … … 75 75 if ( isset( $returns[4] ) ) 76 76 $new_option->locale = esc_attr( $returns[4] ); 77 if ( isset( $returns[5] ) ) 78 $new_option->php_version = esc_attr( $returns[5] ); 79 if ( isset( $returns[6] ) ) 80 $new_option->mysql_version = esc_attr( $returns[6] ); 77 81 $new_options[] = $new_option; 78 82 }
Note: See TracChangeset
for help on using the changeset viewer.