Ticket #5932: 5932.8.diff
File 5932.8.diff, 1.1 KB (added by , 11 years ago) |
---|
-
src/wp-includes/wp-db.php
1371 1371 /** 1372 1372 * Check that the connection to the database is still up. If not, try to reconnect. 1373 1373 * 1374 * If this function is unable to reconnect, it will forcibly die. 1374 * If this function is unable to reconnect, it will forcibly die before wp_head has been 1375 * triggered, or return false after wp_head has been triggered. 1375 1376 * 1376 1377 * @since 3.9.0 1377 1378 * … … 1414 1415 sleep( 1 ); 1415 1416 } 1416 1417 1418 // If wp_head has already happened, wp_die()/dead_db() won't work properly, 1419 // so let's just return and hope for the best. 1420 if ( did_action( 'wp_head' ) ) { 1421 return false; 1422 } 1423 1417 1424 // We weren't able to reconnect, so we better bail. 1418 1425 $this->bail( sprintf( ( " 1419 1426 <h1>Error reconnecting to the database</h1> … … 1479 1486 if ( empty( $this->dbh ) || 2006 == $mysql_errno ) { 1480 1487 if ( $this->check_connection() ) { 1481 1488 $this->_do_query( $query ); 1489 } else { 1490 $this->insert_id = 0; 1491 return false; 1482 1492 } 1483 1493 } 1484 1494