Commit edece9f8 authored by Andrew Nacin's avatar Andrew Nacin
Browse files

wpdb: set dbh to null when the mysqli connection fails. see #21663.

Built from https://develop.svn.wordpress.org/trunk@27277


git-svn-id: https://core.svn.wordpress.org/trunk@27133 1a063a9b-81f0-0310-95a4-ce76da25c4cd
parent ad7152ab
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1327,6 +1327,10 @@ class wpdb {
			} else {
				@mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags );
			}

			if ( $this->dbh->connect_errno ) {
				$this->dbh = null;
			}
		} else {
			if ( WP_DEBUG ) {
				$this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );