[wp-trac] [WordPress Trac] #45299: `wpdb->last_result` may not be countable

WordPress Trac noreply at wordpress.org
Thu Nov 22 03:58:23 UTC 2018


#45299: `wpdb->last_result` may not be countable
--------------------------------------------+---------------------
 Reporter:  desrosj                         |       Owner:  (none)
     Type:  defect (bug)                    |      Status:  new
 Priority:  normal                          |   Milestone:  5.0
Component:  Database                        |     Version:
 Severity:  normal                          |  Resolution:
 Keywords:  php73 has-patch has-unit-tests  |     Focuses:
--------------------------------------------+---------------------

Comment (by pento):

 In [changeset:"43934" 43934]:
 {{{
 #!CommitTicketReference repository="" revision="43934"
 WPDB: Check that `$wpdb->last_result` is countable before counting with
 it.

 `wpdb::get_col()` iterates over `$wpdb->last_result`, which can be a non-
 countable value, should the preceeding query have failed.

 Props spacedmonkey, desrosj.
 See #45299.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45299#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list