When WP_DEBUG is set to true, suppress deprecated errors from firing when calling mysql_connect(), which is officially deprecated in PHP 5.5. We will remove this shameful code as soon as is humanly possible.

Props wonderboymusic. Extra love to tierra and nacin.
Fixes #26322.



git-svn-id: https://develop.svn.wordpress.org/trunk@26512 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2013-12-02 00:08:57 +00:00
parent 8a10f4a942
commit 50edc63cc9

View File

@ -1139,7 +1139,15 @@ class wpdb {
$client_flags = defined( 'MYSQL_CLIENT_FLAGS' ) ? MYSQL_CLIENT_FLAGS : 0;
if ( WP_DEBUG ) {
$error_reporting = false;
if ( defined( 'E_DEPRECATED' ) ) {
$error_reporting = error_reporting();
error_reporting( $error_reporting ^ E_DEPRECATED );
}
$this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
if ( false !== $error_reporting ) {
error_reporting( $error_reporting );
}
} else {
$this->dbh = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
}