Changeset 8739
- Timestamp:
- 08/26/2008 10:30:56 PM (16 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/update.php
r8644 r8739 24 24 return; 25 25 26 global $wp_version ;26 global $wp_version, $wpdb; 27 27 $php_version = phpversion(); 28 28 … … 41 41 $new_option->version_checked = $wp_version; 42 42 43 $url = "http://api.wordpress.org/core/version-check/1.2/?version=$wp_version&php=$php_version&locale=$locale"; 43 if ( method_exists( $wpdb, 'db_version' ) ) 44 $mysql_version = preg_replace('/[^0-9.].*/', '', $wpdb->db_version($wpdb->users)); 45 else 46 $mysql_version = 'N/A'; 47 48 $url = "http://api.wordpress.org/core/version-check/1.2/?version=$wp_version&php=$php_version&locale=$locale&mysql=$mysql_version"; 44 49 45 50 $options = array('timeout' => 3); -
trunk/wp-includes/wp-db.php
r8738 r8739 905 905 global $wp_version; 906 906 // Make sure the server has MySQL 4.0 907 $mysql_version = preg_replace('|[^0-9\.]|', '', @mysql_get_server_info($this->dbh)); 908 if ( version_compare($mysql_version, '4.0.0', '<') ) 907 if ( version_compare($this->db_version(), '4.0.0', '<') ) 909 908 return new WP_Error('database_version',sprintf(__('<strong>ERROR</strong>: WordPress %s requires MySQL 4.0.0 or higher'), $wp_version)); 910 909 } … … 921 920 function supports_collation() 922 921 { 923 return ( version_compare( mysql_get_server_info($this->dbh), '4.1.0', '>=') );922 return ( version_compare($this->db_version(), '4.1.0', '>=') ); 924 923 } 925 924 … … 969 968 } 970 969 970 /** 971 * The database version number 972 * @return false|string false on failure, version number on success 973 */ 974 function db_version() { 975 return preg_replace('/[^0-9.].*/', '', mysql_get_server_info( $this->dbh )); 976 } 971 977 } 972 978
Note: See TracChangeset
for help on using the changeset viewer.