Make WordPress Core

Ticket #36629: 36629.diff

File 36629.diff, 1.1 KB (added by pento, 10 years ago)
  • src/wp-includes/wp-db.php

     
    14861486                                }
    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 ) {
    14921496                                $this->dbh = null;
    … …  
    15121516                                }
    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
    15181526                if ( ! $this->dbh && $allow_bail ) {