WPDB: Reset connection status variables when the connection is closed.

Fixes #36240.



git-svn-id: https://develop.svn.wordpress.org/trunk@36997 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast 2016-03-15 03:27:14 +00:00
parent 2909283a7f
commit 8233227667
2 changed files with 5 additions and 0 deletions

View File

@ -3116,6 +3116,8 @@ class wpdb {
if ( $closed ) {
$this->dbh = null;
$this->ready = false;
$this->has_connected = false;
}
return $closed;

View File

@ -946,6 +946,9 @@ class Tests_DB extends WP_UnitTestCase {
$this->assertTrue( $wpdb->close() );
$this->assertFalse( $wpdb->close() );
$this->assertFalse( $wpdb->ready );
$this->assertFalse( $wpdb->has_connected );
$wpdb->check_connection();
$this->assertTrue( $wpdb->close() );