WordPress.org

Make WordPress Core

Changeset 21511


Ignore:
Timestamp:
08/14/12 20:21:10 (20 months ago)
Author:
nacin
Message:

Eliminate error suppression for mysql_free_result() and only call it when the result is actually a resource. Depending on the query, mysql_query() can return a boolean rather than a resource, hence the original use of error suppression.

Fixes a warning introduced in [21472] when calling mysql_free_result() was moved to flush().

fixes #20838.

File:
1 edited

Legend:

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

    r21473 r21511  
    130130     */ 
    131131    var $last_result; 
     132 
     133    /** 
     134     * MySQL result, which is either a resource or boolean. 
     135     * 
     136     * @since unknown 
     137     * @access protected 
     138     * @var mixed 
     139     */ 
     140    protected $result; 
    132141 
    133142    /** 
     
    10771086        $this->col_info    = null; 
    10781087        $this->last_query  = null; 
    1079         @mysql_free_result( $this->result ); 
     1088 
     1089        if ( is_resource( $this->result ) ) 
     1090            mysql_free_result( $this->result ); 
    10801091    } 
    10811092 
Note: See TracChangeset for help on using the changeset viewer.