Skip to:
Content

BuddyPress.org

Ticket #5704: 5704.02.patch

File 5704.02.patch, 1.1 KB (added by imath, 10 years ago)
  • src/bp-xprofile/bp-xprofile-filters.php

    diff --git src/bp-xprofile/bp-xprofile-filters.php src/bp-xprofile/bp-xprofile-filters.php
    index c049194..7ca7138 100644
    add_filter( 'bp_get_the_site_member_profile_data', 'xprofile_filter_format_ 
    5252add_filter( 'bp_get_the_profile_field_value',           'xprofile_filter_link_profile_data',  9, 2 );
    5353
    5454add_filter( 'xprofile_data_value_before_save',          'xprofile_sanitize_data_value_before_save', 1, 2 );
     55add_filter( 'xprofile_field_options_before_save',       'bp_xprofile_sanitize_options_before_save', 1, 2 );
    5556add_filter( 'xprofile_filtered_data_value_before_save', 'trim', 2 );
    5657
    5758/**
    function bp_xprofile_filter_meta_query( $q ) { 
    356357
    357358        return $q;
    358359}
     360
     361/**
     362 * Filter field options before saving it to database.
     363 *
     364 * @since BuddyPress (2.1.0)
     365 *
     366 * @param array $options.
     367 * @return array stripslahed values
     368 */
     369function bp_xprofile_sanitize_options_before_save( $options = array() ) {
     370        return array_map( 'stripslashes', $options );
     371}