Forum Replies Created
-
I found a more reasonable solution than the original.
simply authorize img tag everywhere.
I’m working on allowing it only for the signature field but that will not be easy
simply add that to your function.php
// Add img tag to wp_kses filter function gawd_allowed_tags() { global $allowedtags; $allowedtags['img'] = array( 'src' => array () ); } add_action('init', 'gawd_allowed_tags', 10);
*(updating tags)
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 );
Same problem here,
I’ve even tried to modify xprofile_filter_kses directly to add img tag without any success.
Apparently the fields are being filtered more than once.
here’s my modified code
function xprofile_filter_kses( $content, $data_obj = null ) { global $allowedtags; $xprofile_allowedtags = $allowedtags; $xprofile_allowedtags['a']['img']['rel'] = array(); $xprofile_allowedtags = apply_filters( 'xprofile_allowed_tags', $xprofile_allowedtags, $data_obj ); return wp_kses( $content, $xprofile_allowedtags ); }