Ticket #5742: 5742.patch
| File 5742.patch, 2.9 KB (added by , 12 years ago) |
|---|
-
bp-xprofile/bp-xprofile-classes.php
1097 1097 1098 1098 $this->user_id = apply_filters( 'xprofile_data_user_id_before_save', $this->user_id, $this->id ); 1099 1099 $this->field_id = apply_filters( 'xprofile_data_field_id_before_save', $this->field_id, $this->id ); 1100 $this->value = apply_filters( 'xprofile_data_value_before_save', $this->value, $this-> id );1100 $this->value = apply_filters( 'xprofile_data_value_before_save', $this->value, $this->field_id ); 1101 1101 $this->last_updated = apply_filters( 'xprofile_data_last_updated_before_save', bp_core_current_time(), $this->id ); 1102 1102 1103 1103 do_action_ref_array( 'xprofile_data_before_save', array( $this ) ); -
bp-xprofile/bp-xprofile-filters.php
62 62 * Run profile field values through kses with filterable allowed tags. 63 63 * 64 64 * @param string $content 65 * @param int $field_id 65 66 * @return string $content 66 67 */ 67 function xprofile_filter_kses( $content ) {68 function xprofile_filter_kses( $content, $field_id = null ) { 68 69 global $allowedtags; 69 70 70 71 $xprofile_allowedtags = $allowedtags; 71 72 $xprofile_allowedtags['a']['rel'] = array(); 72 73 73 $xprofile_allowedtags = apply_filters( 'xprofile_allowed_tags', $xprofile_allowedtags );74 $xprofile_allowedtags = apply_filters( 'xprofile_allowed_tags', $xprofile_allowedtags, $field_id ); 74 75 return wp_kses( $content, $xprofile_allowedtags ); 75 76 } 76 77 … … 94 95 95 96 // Filter single value 96 97 if ( !is_array( $field_value ) ) { 97 $kses_field_value = xprofile_filter_kses( $field_value );98 $kses_field_value = xprofile_filter_kses( $field_value, $field_id ); 98 99 $filtered_field_value = wp_rel_nofollow( force_balance_tags( $kses_field_value ) ); 99 $filtered_field_value = apply_filters( 'xprofile_filtered_data_value_before_save', $filtered_field_value, $field_value );100 $filtered_field_value = apply_filters( 'xprofile_filtered_data_value_before_save', $filtered_field_value, $field_value, $field_id ); 100 101 101 102 // Filter each array item independently 102 103 } else { 103 104 $filtered_values = array(); 104 105 foreach ( (array) $field_value as $value ) { 105 $kses_field_value = xprofile_filter_kses( $value );106 $kses_field_value = xprofile_filter_kses( $value, $field_id ); 106 107 $filtered_value = wp_rel_nofollow( force_balance_tags( $kses_field_value ) ); 107 $filtered_values[] = apply_filters( 'xprofile_filtered_data_value_before_save', $filtered_value, $value );108 $filtered_values[] = apply_filters( 'xprofile_filtered_data_value_before_save', $filtered_value, $value, $field_id ); 108 109 109 110 } 110 111