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. git-svn-id: https://develop.svn.wordpress.org/trunk@43578 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8347d7e22f
commit
1e4e60f11c
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user