diff --git a/includes/core/um-filters-account.php b/includes/core/um-filters-account.php index 30c43a92..cf3c5fff 100644 --- a/includes/core/um-filters-account.php +++ b/includes/core/um-filters-account.php @@ -71,7 +71,11 @@ add_filter( "um_get_field__last_name","um_account_disable_name_fields", 10 ,1 ); */ function um_account_sanitize_data( $data ) { foreach ( $data as $key => $value ) { - $data[ $key ] = trim( esc_html( strip_tags( $value ) ) ); + if ( is_array( $value ) ) { + $data[ $key ] = array_filter($value, 'um_strip_tags_array'); + } else { + $data[ $key ] = trim( esc_html( strip_tags( $value ) ) ); + } } return $data; diff --git a/includes/um-short-functions.php b/includes/um-short-functions.php index 8779538d..1669a83b 100644 --- a/includes/um-short-functions.php +++ b/includes/um-short-functions.php @@ -2712,4 +2712,12 @@ if ( ! function_exists( 'um_is_profile_owner' ) ) { return ( $user_id == um_profile_id() ); } +} + +/** + * Strip tags if array + */ +function um_strip_tags_array( $var ) { + $var = trim( esc_html( strip_tags( $var ) ) ); + return $var; } \ No newline at end of file