wpdb: When flushing results on a mysqli connection, make sure that wpdb::$dbh
is a valid mysqli connection handle.
Fixes a unit test failure introduced in [30297]. Fixes #28155. Props soulseekah. git-svn-id: https://develop.svn.wordpress.org/trunk@30299 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
df11fb8593
commit
c2fb136b47
@ -1326,6 +1326,11 @@ class wpdb {
|
||||
mysqli_free_result( $this->result );
|
||||
$this->result = null;
|
||||
|
||||
// Sanity check before using the handle
|
||||
if ( empty( $this->dbh ) || !( $this->dbh instanceof mysqli ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Clear out any results from a multi-query
|
||||
while ( mysqli_more_results( $this->dbh ) ) {
|
||||
mysqli_next_result( $this->dbh );
|
||||
|
Loading…
Reference in New Issue
Block a user