#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 |
---|---|---|---|
Milestone: | 4.9 | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | has-patch has-unit-tests dev-reviewed commit |
Focuses: | Cc: |
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
@
7 years ago
- Keywords needs-testing added
- Milestone changed from Awaiting Review to 4.9
- Version trunk deleted
Moving to 4.9 for visibility.
#3
@
7 years ago
In this case It'd probably be better to change it to if ( empty( $wp_settings_errors ) ) return array();
#4
@
7 years ago
- Summary changed from PHP7.2 Countable to 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.
Check is_array() before calling count()