Make WordPress Core

Opened 9 years ago

Closed 8 years ago

#40741 closed defect (bug) (duplicate)

REST Comments Controller: Don't use count() if $request['post'] isn't an array

Reported by: ocean90 Owned by:
Priority: normal Milestone:
Component: Comments Version: 4.7
Severity: normal Keywords:
Cc: Focuses: rest-api

Description

Counting of non-countable objects will start throwing a warning in PHP 7.2.

In the comments controller it seems like we also use count() on an integer value: https://core.trac.wordpress.org/browser/trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php?marks=1536&rev=40606#L1529

Output of a build with PHP Nightly: https://travis-ci.org/WordPress/wordpress-develop/jobs/231375211#L1311-L1664

Introduced in [39349].

Change History (2)

#1 @birgire
8 years ago

  • Milestone Awaiting Review

This seems to be fixed in [41735] for the ticket #41457

Should this one be closed as a duplicate, even though it's an older one?

#2 @ocean90
8 years ago

  • Keywords needs-patch removed
  • Resolutionduplicate
  • Status newclosed

Duplicate of #41457.

Note: See TracTickets for help on using tickets.