Skip to:

Opened 11 years ago

Closed 7 years ago

#4704 closed defect (bug) (worksforme)

Member search on string containing apostrophe returns no results.

Reported by: kevingamin's profile kevingamin Owned by:
Milestone: Priority: normal
Severity: major Version: 1.0
Component: Members Keywords:


When performing a search on a Buddypress member directory with a string containing an apostrophe (ex. Tony K's), the search returns zero results. Performing a partial search (ex. Tony or Tony K) will return results, including the desired one. This affects mutilple versions and was specifically tested on 1.2.8 in WP 3.1.4 and on 1.6.1 in WP 3.4.2.

Change History (3)

#1 @DJPaul
11 years ago

Thanks for reporting this; I've seen it before, though I couldn't find an existing ticket. I'm pretty sure this will affect searches other than xprofile, but for xprofile:

1) Set xprofile name to "Paul's".
2) Look in xprofile data DB table; value is stored as "Paul\'s".
3) SQL query for the search terms logic in BP_User_Query::prepare_user_ids_query() is:
"SELECT user_id FROM wp_bp_xprofile_data WHERE value LIKE '%%paul

(that's three backslashes in the above -- Trac is eating some)

Compare against how WP stores database data in post title and content; "Paul's" is literally stored as "Paul's", which is what #2776 is about.

Last edited 11 years ago by DJPaul (previous) (diff)

#2 @DJPaul
11 years ago

  • Milestone changed from Awaiting Review to Future Release
  • Version changed from 1.6.1 to 1.0

#3 @slaFFik
7 years ago

  • Keywords needs-testing needs-patch removed
  • Milestone Future Release deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Seems it was already fixed quite a lot of time ago. Works with the latest code from Trunk.

Note: See TracTickets for help on using tickets.