Make WordPress Core


Ignore:
Timestamp:
04/22/2016 05:18:08 AM (9 years ago)
Author:
pento
Message:

Database: Suppress connection error messages when WP_DEBUG isn't enabled.

This is a partial revert of [35860], which has been causing un-catchable warnings to be generated on some server configurations.

Fixes #36629 for trunk.
See #21870.

File:
1 edited

Legend:

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

    r37086 r37292  
    14871487            }
    14881488
    1489             mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags );
     1489            if ( WP_DEBUG ) {
     1490                mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags );
     1491            } else {
     1492                @mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags );
     1493            }
    14901494
    14911495            if ( $this->dbh->connect_errno ) {
     
    15131517            }
    15141518        } else {
    1515             $this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
     1519            if ( WP_DEBUG ) {
     1520                $this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
     1521            } else {
     1522                $this->dbh = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
     1523            }
    15161524        }
    15171525
Note: See TracChangeset for help on using the changeset viewer.