wpdb: set dbh to null when the mysqli connection fails. see #21663.
git-svn-id: https://develop.svn.wordpress.org/trunk@27277 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
5e8787d0de
commit
b84ed60fa9
@ -1327,6 +1327,10 @@ class wpdb {
|
|||||||
} else {
|
} else {
|
||||||
@mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags );
|
@mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( $this->dbh->connect_errno ) {
|
||||||
|
$this->dbh = null;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if ( WP_DEBUG ) {
|
if ( WP_DEBUG ) {
|
||||||
$this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
|
$this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
|
||||||
|
Loading…
Reference in New Issue
Block a user