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)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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?