#42498 closed defect (bug) (fixed)
Replace count() call with empty() in get_settings_errors() to prevent PHP 7.2 warnings
| Reported by: | pross | Owned by: | westonruter |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.9 |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests dev-reviewed commit |
| Cc: | Focuses: |
Description
Related #40109
In latest PHP7.1 RC6 any settings page throws a warning
Warning: count(): Parameter must be an array or an object that implements Countable in /****/public_html/wp-admin/includes/template.php on line 1460
Attachments (3)
Change History (10)
#2
@
9 years ago
- Keywords needs-testing added
- Milestone Awaiting Review → 4.9
- Version trunk
Moving to 4.9 for visibility.
#3
@
9 years ago
In this case It'd probably be better to change it to if ( empty( $wp_settings_errors ) ) return array();
#4
@
9 years ago
- Summary PHP7.2 Countable → Replace count() call with empty() in get_settings_errors() to prevent PHP 7.2 warnings
Updated the issue title to convey more information at glance. 👍 42498.2.patch
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Check is_array() before calling count()