WordPress.org

Make WordPress Core

Ticket #14654: 14654.patch

File 14654.patch, 621 bytes (added by hakre, 8 years ago)

Do Errors on first mysql_connect when WP_DEBUG is true

  • wp-includes/wp-db.php

     
    517517
    518518                $this->dbuser = $dbuser;
    519519
    520                 $this->dbh = @mysql_connect( $dbhost, $dbuser, $dbpassword, true );
     520                if ( WP_DEBUG ) {
     521                        $this->dbh = mysql_connect( $dbhost, $dbuser, $dbpassword, true );
     522                } else {
     523                        $this->dbh = @mysql_connect( $dbhost, $dbuser, $dbpassword, true );
     524                }
     525
    521526                if ( !$this->dbh ) {
    522527                        $this->bail( sprintf( /*WP_I18N_DB_CONN_ERROR*/"
    523528<h1>Error establishing a database connection</h1>