Make WordPress Core


Ignore:
Timestamp:
12/02/2013 12:08:57 AM (11 years ago)
Author:
wonderboymusic
Message:

When WP_DEBUG is set to true, suppress deprecated errors from firing when calling mysql_connect(), which is officially deprecated in PHP 5.5. We will remove this shameful code as soon as is humanly possible.

Props wonderboymusic. Extra love to tierra and nacin.
Fixes #26322.

File:
1 edited

Legend:

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

    r25284 r26512  
    11401140
    11411141        if ( WP_DEBUG ) {
     1142            $error_reporting = false;
     1143            if ( defined( 'E_DEPRECATED' ) ) {
     1144                $error_reporting = error_reporting();
     1145                error_reporting( $error_reporting ^ E_DEPRECATED );
     1146            }
    11421147            $this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
     1148            if ( false !== $error_reporting ) {
     1149                error_reporting( $error_reporting );
     1150            }
    11431151        } else {
    11441152            $this->dbh = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
Note: See TracChangeset for help on using the changeset viewer.