WordPress.org

Make WordPress Core

Changeset 30677


Ignore:
Timestamp:
12/01/2014 12:02:55 AM (6 years ago)
Author:
pento
Message:

WPDB: Before fetching results, make sure we have a valid result resource to fetch them from.

Fixes #27982.

File:
1 edited

Legend:

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

    r30664 r30677  
    16691669        } else {
    16701670            $num_rows = 0;
    1671             if ( $this->use_mysqli ) {
     1671            if ( $this->use_mysqli && $this->result instanceof mysqli_result ) {
    16721672                while ( $row = @mysqli_fetch_object( $this->result ) ) {
    16731673                    $this->last_result[$num_rows] = $row;
    16741674                    $num_rows++;
    16751675                }
    1676             } else {
     1676            } else if ( is_resource( $this->result ) ) {
    16771677                while ( $row = @mysql_fetch_object( $this->result ) ) {
    16781678                    $this->last_result[$num_rows] = $row;
Note: See TracChangeset for help on using the changeset viewer.