Changeset 27279
- Timestamp:
- 02/26/2014 04:53:21 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/wp-db.php
r27278 r27279 970 970 if ( ! $success ) { 971 971 $this->ready = false; 972 wp_load_translations_early(); 973 $this->bail( sprintf( __( '<h1>Can’t select database</h1> 972 if ( ! did_action( 'template_redirect' ) ) { 973 wp_load_translations_early(); 974 $this->bail( sprintf( __( '<h1>Can’t select database</h1> 974 975 <p>We were able to connect to the database server (which means your username and password is okay) but not able to select the <code>%1$s</code> database.</p> 975 976 <ul> … … 979 980 </ul> 980 981 <p>If you don\'t know how to set up a database you should <strong>contact your host</strong>. If all else fails you may find help at the <a href="http://wordpress.org/support/">WordPress Support Forums</a>.</p>' ), htmlspecialchars( $db, ENT_QUOTES ), htmlspecialchars( $this->dbuser, ENT_QUOTES ) ), 'db_select_fail' ); 982 } 981 983 return; 982 984 } … … 1379 1381 * Check that the connection to the database is still up. If not, try to reconnect. 1380 1382 * 1381 * If this function is unable to reconnect, it will forcibly die. 1383 * If this function is unable to reconnect, it will forcibly die, or if after the 1384 * the template_redirect hook has been fired, return false instead. 1382 1385 * 1383 1386 * @since 3.9.0 … … 1420 1423 1421 1424 sleep( 1 ); 1425 } 1426 1427 // If template_redirect has already happened, it's too late for wp_die()/dead_db(). 1428 // Let's just return and hope for the best. 1429 if ( did_action( 'template_redirect' ) ) { 1430 return false; 1422 1431 } 1423 1432 … … 1487 1496 if ( $this->check_connection() ) { 1488 1497 $this->_do_query( $query ); 1498 } else { 1499 $this->insert_id = 0; 1500 return false; 1489 1501 } 1490 1502 }
Note: See TracChangeset
for help on using the changeset viewer.