Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: HTML in Profile Field again!

@patrix87

Participant

I made some “progress”

I found this and I can agree that it is still true.
https://buddypress.trac.wordpress.org/ticket/5971
Filtering is inconsistent and sometime happens twice.

I think this should be something to look into somewhat soon.

Anyway here is the minimum you have to do to turn off html filtering.

BUT it makes you website a lot more vulnerable to attacks and errors so use it at your own risk.

Add this code to your child theme function.php


//Unfilter xprofile *risky*

remove_filter( 'bp_get_the_profile_field_value',           'xprofile_filter_kses', 1 );
remove_filter( 'bp_get_the_profile_field_edit_value',      'wp_filter_kses',       1 );
remove_filter( 'xprofile_get_field_data',                  'wp_filter_kses', 1 );
remove_filter( 'bp_xprofile_set_field_data_pre_validate',  'xprofile_filter_pre_validate_value_by_field_type', 10, 3 );
remove_filter( 'xprofile_data_value_before_save',          'xprofile_sanitize_data_value_before_save', 1, 4 );

Skip to toolbar