Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/12/2014 02:16:48 PM (11 years ago)
Author:
johnjamesjacoby
Message:

Escape search URL's in xprofile_filter_link_profile_data() and add phpdoc block.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/bp-xprofile-filters.php

    r8672 r8815  
    198198}
    199199
     200/**
     201 * Filter an Extended Profile field value, and attempt to make clickable links
     202 * to members search results out of them.
     203 *
     204 * - Not run on datebox field types
     205 * - Not run on values without commas with less than 5 words
     206 * - URL's are made clickable
     207 * - To disable: remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 2 );
     208 *
     209 * @since BuddyPress (1.1)
     210 *
     211 * @param string $field_value
     212 * @param string  $field_type
     213 * @return string
     214 */
    200215function xprofile_filter_link_profile_data( $field_value, $field_type = 'textbox' ) {
    201216
     
    228243                } else {
    229244                    $search_url   = add_query_arg( array( 's' => urlencode( $value ) ), bp_get_members_directory_permalink() );
    230                     $new_values[] = '<a href="' . $search_url . '" rel="nofollow">' . $value . '</a>';
     245                    $new_values[] = '<a href="' . esc_url( $search_url ) . '" rel="nofollow">' . $value . '</a>';
    231246                }
    232247            }
Note: See TracChangeset for help on using the changeset viewer.