Make WordPress Core

Ticket #23085: 23085.3.patch

File 23085.3.patch, 517 bytes (added by Craig Ralston, 8 years ago)

refresh of 23085.2.diff

  • wp-includes/wp-db.php

     
    16701670                        $this->last_error = mysql_error( $this->dbh );
    16711671                }
    16721672
    1673                 if ( $this->last_error ) {
     1673                if ( is_resource( $this->dbh ) && $this->last_error ) {
    16741674                        // Clear insert_id on a subsequent failed insert.
    16751675                        if ( $this->insert_id && preg_match( '/^\s*(insert|replace)\s/i', $query ) )
    16761676                                $this->insert_id = 0;