#43368 closed defect (bug) (duplicate)
Fix the warning of count() in php 7.2.0
| Reported by: | anonymized_15003776 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Posts, Post Types | Version: | 5.1 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
When the version of PHP was 7.2.0, count() will now yield a warning on invalid countable types passed to the array_or_countable parameter.
/wp-includes/post-template.php
Line:284
if ( $page > count( $pages ) )
$page = count( $pages );
to
if ( $page > count( $pages ? : [] ) )
$page = count( $pages ? : [] );
Attachments (1)
Change History (3)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Hi there and thanks for your report!
Please note that this is already being tracked in #42814.