X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/61343b82c4f0da4c68e4c6373daafff4a81efdd1..ceb5a929e00123b4e224977c6b5a149f6431b250:/wp-includes/wp-db.php diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index 2398002e..9fcd4a7c 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -1139,7 +1139,15 @@ class wpdb { $client_flags = defined( 'MYSQL_CLIENT_FLAGS' ) ? MYSQL_CLIENT_FLAGS : 0; if ( WP_DEBUG ) { + $error_reporting = false; + if ( defined( 'E_DEPRECATED' ) ) { + $error_reporting = error_reporting(); + error_reporting( $error_reporting ^ E_DEPRECATED ); + } $this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags ); + if ( false !== $error_reporting ) { + error_reporting( $error_reporting ); + } } else { $this->dbh = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags ); } @@ -1180,8 +1188,14 @@ class wpdb { function query( $query ) { if ( ! $this->ready ) return false; - - // some queries are made before the plugins have been loaded, and thus cannot be filtered with this method + /** + * Filter the database query. + * + * Some queries are made before the plugins have been loaded, and thus cannot be filtered with this method. + * + * @since 2.1.0 + * @param string $query Database query. + */ $query = apply_filters( 'query', $query ); $return_val = 0;