Ticket #8420: wp-db.diff
File wp-db.diff, 1.2 KB (added by , 14 years ago) |
---|
-
wp-includes/wp-db.php
1483 1482 * 1484 1483 * Will not die if wpdb::$show_errors is true 1485 1484 * 1486 * Will give out ajax response if failed while DOING_AJAX1487 *1488 1485 * @since 1.5.0 1489 1486 * 1490 1487 * @param string $message The Error message … … 1492 1489 * @return false|void 1493 1490 */ 1494 1491 function bail( $message, $error_code = '500' ) { 1495 if((defined('DOING_AJAX') && DOING_AJAX)) {1496 $id = isset($_POST['post_ID'])? (int) $_POST['post_ID'] : 0;1497 $message = new WP_Error('autosave_failed', /*WP_I18N_AUTOSAVE_FAILED*/'Connection to database failed. Couldn\'t autosave.'/*/WP_I18N_AUTOSAVE_FAILED*/);1498 $x = new WP_Ajax_Response( array(1499 'what' => 'autosave',1500 'data' => $message->errors['autosave_failed']['0'],1501 'id' => $id1502 ) );1503 $x->send();1504 die;1505 }1506 1492 if ( !$this->show_errors ) { 1507 1493 if ( class_exists( 'WP_Error' ) ) 1508 1494 $this->error = new WP_Error($error_code, $message);