mirror of
git://develop.git.wordpress.org/
synced 2025-03-15 09:29:48 +01:00
Database: Suppress connection error messages when WP_DEBUG
isn't enabled.
This is a partial revert of [35860], which has been causing un-catchable warnings to be generated on some server configurations. Merge of [37292] to the 4.5 branch. Fixes #36629. See #21870. git-svn-id: https://develop.svn.wordpress.org/branches/4.5@37293 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4797b0d56a
commit
329664a70a
@ -1486,7 +1486,11 @@ class wpdb {
|
||||
}
|
||||
}
|
||||
|
||||
if ( WP_DEBUG ) {
|
||||
mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags );
|
||||
} else {
|
||||
@mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags );
|
||||
}
|
||||
|
||||
if ( $this->dbh->connect_errno ) {
|
||||
$this->dbh = null;
|
||||
@ -1512,7 +1516,11 @@ class wpdb {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ( WP_DEBUG ) {
|
||||
$this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
|
||||
} else {
|
||||
$this->dbh = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->dbh && $allow_bail ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user