Settings: Replace `count()` call with `empty()` in `get_settings_errors()` to prevent PHP 7.2 warnings when `$wp_settings_errors` is `null`.

Props pross, dd32, westonruter.
See #40109.
Fixes #42498 for 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42147


git-svn-id: http://core.svn.wordpress.org/branches/4.9@41978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2017-11-10 22:32:47 +00:00
parent 389166f9aa
commit a647fbead2
2 changed files with 3 additions and 2 deletions

View File

@ -1457,8 +1457,9 @@ function get_settings_errors( $setting = '', $sanitize = false ) {
} }
// Check global in case errors have been added on this pageload. // Check global in case errors have been added on this pageload.
if ( ! count( $wp_settings_errors ) ) if ( empty( $wp_settings_errors ) ) {
return array(); return array();
}
// Filter the results to those of a specific setting if one was set. // Filter the results to those of a specific setting if one was set.
if ( $setting ) { if ( $setting ) {

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.9-RC2-42145'; $wp_version = '4.9-RC2-42147';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.