From 1422d8ffd902c72877d0d8b2a2e2e3fe73883058 Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Sun, 19 Aug 2018 16:38:24 +0000 Subject: [PATCH] Customize: Safeguard a check on the `customize_validate_{$setting_id}` filter value to ensure it is a `WP_Error`. While the filter is documented to only support a `WP_Error`, it has been a common practice to return true in a validation function if no errors have occurred. This was already caught when the same filter was executed in `WP_Customize_Setting`, it was however missing in `WP_Customize_Manager::validate_setting_values()`. Fixes #44809. Built from https://develop.svn.wordpress.org/trunk@43578 git-svn-id: http://core.svn.wordpress.org/trunk@43407 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-customize-manager.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-wp-customize-manager.php b/wp-includes/class-wp-customize-manager.php index 256e68a036..ed8c76df24 100644 --- a/wp-includes/class-wp-customize-manager.php +++ b/wp-includes/class-wp-customize-manager.php @@ -2304,7 +2304,7 @@ final class WP_Customize_Manager { if ( ! is_wp_error( $validity ) ) { /** This filter is documented in wp-includes/class-wp-customize-setting.php */ $late_validity = apply_filters( "customize_validate_{$setting->id}", new WP_Error(), $unsanitized_value, $setting ); - if ( $late_validity->has_errors() ) { + if ( is_wp_error( $late_validity ) && $late_validity->has_errors() ) { $validity = $late_validity; } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 10c644bd31..c535f88be9 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-43577'; +$wp_version = '5.0-alpha-43578'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.