[wp-trac] [WordPress Trac] #37508: wpdb->result instance should be checked `mysqli_num_fields` in `load_col_info()`
WordPress Trac
noreply at wordpress.org
Fri Jul 29 07:33:54 UTC 2016
#37508: wpdb->result instance should be checked `mysqli_num_fields` in
`load_col_info()`
--------------------------------+-----------------------------
Reporter: giuseppe.mazzapica | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Database | Version: trunk
Severity: normal | Keywords:
Focuses: |
--------------------------------+-----------------------------
In `wpdb::load_col_info()` the function `mysqli_num_fields()` is called
passing `$this->result` without any check on this property value.
The problem is that function has a type hint to `mysqli_result` (see
http://php.net/manual/en/mysqli-result.field-count.php), but
`$this->result` may be `false`.
Just like in other places in the same class, the function should check
that `$this->result instanceof mysqli_result` before calling
`mysqli_num_fields()`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37508>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list