Don't improperly whitescreen on incorrect DB credentials during setup-config. Show error message with an opportunity to try again. fixes #15682.

git-svn-id: http://svn.automattic.com/wordpress/trunk@16788 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-12-08 07:12:44 +00:00
parent 0a61447061
commit 35b4860563
2 changed files with 9 additions and 3 deletions

View File

@ -176,8 +176,10 @@ switch($step) {
// We'll fail here if the values are no good.
require_wp_db();
if ( !empty($wpdb->error) )
wp_die($wpdb->error->get_error_message());
if ( ! empty( $wpdb->error ) ) {
$back = '<p class="step"><a href="setup-config.php?step=1" onclick="javascript:history.go(-1);return false;" class="button">Try Again</a></p>';
wp_die( $wpdb->error->get_error_message() . $back );
}
// Fetch or generate keys and salts.
$no_api = isset( $_POST['noapi'] );

View File

@ -1044,7 +1044,11 @@ class wpdb {
<p>If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the <a href='http://wordpress.org/support/'>WordPress Support Forums</a>.</p>
"/*/WP_I18N_DB_CONN_ERROR*/, $this->dbhost ), 'db_connect_fail' );
//If show errors is disabled then we need to die anyway as we don't have a working DB connection
// If show errors is disabled then we need to die anyway as we don't have a working DB connection
// unless we're trying to test the initial connection, in which case setup-config.php will handle.
if ( defined( 'WP_SETUP_CONFIG' ) )
return;
die();
}