- fix privacy update on the account page

This commit is contained in:
andrewshuba
2019-07-17 14:45:09 +03:00
parent d535b63eb1
commit 9fd21a1798
2 changed files with 13 additions and 1 deletions
+5 -1
View File
@@ -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;
+8
View File
@@ -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;
}