[wp-trac] [WordPress Trac] #43201: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /wp-includes/media.php on line 1206

WordPress Trac noreply at wordpress.org
Thu Feb 1 15:17:22 UTC 2018


#43201: PHP Warning:  count(): Parameter must be an array or an object that
implements Countable in /wp-includes/media.php on line 1206
----------------------------------------+--------------------
 Reporter:  codegrau                    |       Owner:
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  4.9.4
Component:  Media                       |     Version:  4.9.2
 Severity:  normal                      |  Resolution:
 Keywords:  needs-patch good-first-bug  |     Focuses:
----------------------------------------+--------------------
Changes (by SergeyBiryukov):

 * keywords:   => needs-patch good-first-bug
 * component:  General => Media
 * milestone:  Awaiting Review => 4.9.4


Comment:

 Hi @codegrau, welcome to WordPress Trac! Thanks for the report.

 This sound like a plugin incorrectly using the `wp_calculate_image_srcset`
 filter and returning a non-array. That said, we should make sure
 `$sources` is an array before calling `count()`.

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


More information about the wp-trac mailing list