Changeset 12523 for trunk/wp-admin/update-core.php
- Timestamp:
- 12/23/2009 06:35:12 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/update-core.php (modified) (4 diffs)
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 )
Note: See TracChangeset
for help on using the changeset viewer.