WordPress.org

Make WordPress Core

Ticket #23085: 23085.2.diff

File 23085.2.diff, 536 bytes (added by mbijon, 5 years ago)

patch update with is_resource()

  • wp-includes/wp-db.php

     
    11991199                        $this->queries[] = array( $query, $this->timer_stop(), $this->get_caller() );
    12001200
    12011201                // If there is an error then take note of it..
    1202                 if ( $this->last_error = mysql_error( $this->dbh ) ) {
     1202                if ( is_resource( $this->dbh ) && $this->last_error = mysql_error( $this->dbh ) ) {
    12031203                        $this->print_error();
    12041204                        return false;
    12051205                }