[wp-trac] [WordPress Trac] #48599: Warning: count(): Parameter must be an array or an object that implements Countable in ../wp-admin/includes/plugin.php on line 1392

WordPress Trac noreply at wordpress.org
Wed Nov 13 16:10:34 UTC 2019


#48599: Warning: count(): Parameter must be an array or an object that implements
Countable in ../wp-admin/includes/plugin.php on line 1392
----------------------------+---------------------
 Reporter:  ispreview       |       Owner:  (none)
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  5.3.1
Component:  Administration  |     Version:  5.3
 Severity:  normal          |  Resolution:
 Keywords:  needs-patch     |     Focuses:  ui
----------------------------+---------------------
Changes (by ayeshrajans):

 * Attachment "48599.patch" added.

 These count() warnings can pop up at unexpected places. The attached patch
 checks if the variable is countable (WordPress provides a polyfill for
 `is_countable`) before attempting to actually call `count()`.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48599>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list