Make WordPress Core


Ignore:
Timestamp:
10/14/2010 06:47:39 PM (14 years ago)
Author:
westi
Message:

Display mysql_connect errors when WP_DEBUG is enabled. Fixes #14654 props lloydbudd and hakre
Always die if we can't connect to the db no point in going any futher.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/wp-db.php

    r15638 r15808  
    10271027        global $db_list, $global_db_list;
    10281028
    1029         $this->dbh = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, true );
     1029        if ( WP_DEBUG ) {
     1030            $this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, true );
     1031        } else {
     1032            $this->dbh = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, true );
     1033        }
    10301034
    10311035        if ( !$this->dbh ) {
     
    10401044<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>
    10411045"/*/WP_I18N_DB_CONN_ERROR*/, $this->dbhost ), 'db_connect_fail' );
     1046           
     1047            //If show errors is disabled then we need to die anyway as we don't have a working DB connection
     1048            die();
    10421049        }
    10431050
Note: See TracChangeset for help on using the changeset viewer.