Ticket #2722: 2722.diff
File 2722.diff, 1.5 KB (added by , 17 years ago) |
---|
-
wp-includes/wp-db.php
64 64 if ( defined('DB_COLLATE') ) 65 65 $this->collate = DB_COLLATE; 66 66 67 $this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword );67 $this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword, true); 68 68 if (!$this->dbh) { 69 69 $this->bail(" 70 70 <h1>Error establishing a database connection</h1> … … 81 81 82 82 $this->ready = true; 83 83 84 if ( !empty($this->charset) && version_compare(mysql_get_server_info( ), '4.1.0', '>=') )84 if ( !empty($this->charset) && version_compare(mysql_get_server_info($this->dbh), '4.1.0', '>=') ) 85 85 $this->query("SET NAMES '$this->charset'"); 86 86 87 87 $this->select($dbname); … … 493 493 { 494 494 global $wp_version; 495 495 // Make sure the server has MySQL 4.0 496 $mysql_version = preg_replace('|[^0-9\.]|', '', @mysql_get_server_info( ));496 $mysql_version = preg_replace('|[^0-9\.]|', '', @mysql_get_server_info($this->dbh)); 497 497 if ( version_compare($mysql_version, '4.0.0', '<') ) 498 498 return new WP_Error('database_version',sprintf(__('<strong>ERROR</strong>: WordPress %s requires MySQL 4.0.0 or higher'), $wp_version)); 499 499 } … … 504 504 */ 505 505 function supports_collation() 506 506 { 507 return ( version_compare(mysql_get_server_info( ), '4.1.0', '>=') );507 return ( version_compare(mysql_get_server_info($this->dbh), '4.1.0', '>=') ); 508 508 } 509 509 510 510 /**