Skip to:
Content

BuddyPress.org

Changeset 6202


Ignore:
Timestamp:
07/27/2012 02:54:30 AM (14 years ago)
Author:
johnjamesjacoby
Message:

XProfile:

  • Properly escape xprofile_filter_link_profile_data() output.
  • Revert part of r6201.
  • For 1.5 branch.
  • Props vnd.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.5/bp-xprofile/bp-xprofile-filters.php

    r6201 r6202  
    155155        $values = explode( ',', $field_value );
    156156
    157         if ( $values ) {
    158                 foreach ( (array)$values as $value ) {
     157        if ( !empty( $values ) ) {
     158                foreach ( (array) $values as $value ) {
    159159                        $value = trim( $value );
    160160
    … …  
    162162                        if ( preg_match( '@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', $value ) ) {
    163163                                $new_values[] = make_clickable( $value );
     164
     165                        // Is not clickable
    164166                        } else {
     167
     168                                // More than 5 commas
    165169                                if ( count( explode( ' ', $value ) ) > 5 ) {
    166                                         $new_values[] = esc_html( $value );
     170                                        $new_values[] = $value;
     171
     172                                // Less than 5 commas
    167173                                } else {
    168                                         $new_values[] = '<a href="' . site_url( bp_get_members_root_slug() ) . '/?s=' . esc_url( strip_tags( $value ) ) . '" rel="nofollow">' . esc_html( $value ) . '</a>';
     174                                        $search_url   = add_query_arg( array( 's' => urlencode( $value ) ), bp_get_members_directory_permalink() );
     175                                        $new_values[] = '<a href="' . $search_url . '" rel="nofollow">' . esc_html( $value ) . '</a>';
    169176                                }
    170177                        }
Note: See TracChangeset for help on using the changeset viewer.