Make WordPress Core


Ignore:
Timestamp:
08/19/2018 04:37:12 PM (6 years ago)
Author:
flixos90
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r43571 r43578  
    23052305                /** This filter is documented in wp-includes/class-wp-customize-setting.php */
    23062306                $late_validity = apply_filters( "customize_validate_{$setting->id}", new WP_Error(), $unsanitized_value, $setting );
    2307                 if ( $late_validity->has_errors() ) {
     2307                if ( is_wp_error( $late_validity ) && $late_validity->has_errors() ) {
    23082308                    $validity = $late_validity;
    23092309                }
Note: See TracChangeset for help on using the changeset viewer.