Make WordPress Core

Changeset 37293


Ignore:
Timestamp:
04/22/2016 05:23:40 AM (10 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.

Merge of [37292] to the 4.5 branch.

Fixes #36629.
See #21870.

File:
1 edited

Legend:

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

    r37086 r37293  
    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.