From a647fbead24622be4c7fea8e5b384bd3ada9f390 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 10 Nov 2017 22:32:47 +0000 Subject: [PATCH] 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 --- wp-admin/includes/template.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index ec0fb52591..0c8c863ec7 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -1457,8 +1457,9 @@ function get_settings_errors( $setting = '', $sanitize = false ) { } // Check global in case errors have been added on this pageload. - if ( ! count( $wp_settings_errors ) ) + if ( empty( $wp_settings_errors ) ) { return array(); + } // Filter the results to those of a specific setting if one was set. if ( $setting ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 452bda116d..f3296507a5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @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.