Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/16/2014 12:03:53 PM (12 years ago)
Author:
imath
Message:

Make sure BP_User_Query returns correct results when search term contains the Ampersand character

  1. Search terms containing this character was problematic as the "&" is a query var delimiter used in bp_legacy_theme_ajax_querystring() to build the ajax querystring
  1. When a xProfile field is saved, the value is sanitized using the xprofile_filter_kses() filter which is converting "&" to "&" before inserting the value in database.

Urlencoding the search terms in bp_legacy_theme_ajax_querystring() and applying wp_kses_normalize_entities() to search terms in BP_User_Query & in bp_xprofile_bp_user_query_search() make sure the correct results are returned to the user.

Fixes #5694

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-classes.php

    r8796 r8928  
    369369                // xprofile field matches happen in bp_xprofile_bp_user_query_search()
    370370                if ( false !== $search_terms ) {
    371                         $search_terms = bp_esc_like( $search_terms );
     371                        $search_terms = bp_esc_like( wp_kses_normalize_entities( $search_terms ) );
    372372
    373373                        if ( $search_wildcard === 'left' ) {
Note: See TracChangeset for help on using the changeset viewer.