WordPress.org

Make WordPress Core

Ticket #15682: 15682.diff

File 15682.diff, 1.1 KB (added by nacin, 3 years ago)
  • wp-includes/wp-db.php

     
    10451045"/*/WP_I18N_DB_CONN_ERROR*/, $this->dbhost ), 'db_connect_fail' ); 
    10461046 
    10471047                        //If show errors is disabled then we need to die anyway as we don't have a working DB connection 
     1048                        if ( defined( 'WP_SETUP_CONFIG' ) ) 
     1049                                return; 
     1050 
    10481051                        die(); 
    10491052                } 
    10501053 
  • wp-admin/setup-config.php

     
    176176 
    177177        // We'll fail here if the values are no good. 
    178178        require_wp_db(); 
    179         if ( !empty($wpdb->error) ) 
    180                 wp_die($wpdb->error->get_error_message()); 
     179        if ( ! empty( $wpdb->error ) ) { 
     180                $back = '<p class="step"><a href="setup-config.php?step=1" onclick="javascript:history.go(-1);return false;" class="button">Try Again</a></p>'; 
     181                wp_die( $wpdb->error->get_error_message() . $back ); 
     182        } 
    181183 
    182184        // Fetch or generate keys and salts. 
    183185        $no_api = isset( $_POST['noapi'] );