Skip to:
Content

BuddyPress.org

Opened 11 years ago

Closed 11 years ago

#6546 closed defect (bug) (fixed)

SQL syntax error in BP_Friends_Friendship::search_friends function

Reported by: rittesh.patel Owned by: boonebgorges
Priority: high Milestone: 2.4
Component: Friends Version: 2.3.2
Severity: normal Keywords:
Cc:

Description

Error:

PHP message: WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''ni%''  LIMIT 0, 10

there is a single ' which is causing the error

SELECT DISTINCT user_id FROM wp_usermeta WHERE user_id IN (2) AND meta_key = 'nickname' AND meta_value LIKE 'ni%''  LIMIT 0, 10

From debug log, it was getting called from BP_Friends_Friendship::search_friends https://buddypress.trac.wordpress.org/browser/trunk/src/bp-friends/classes/class-bp-friends-friendship.php#L345

Attachments (1)

6546.patch (1.2 KB ) - added by rittesh.patel 11 years ago.
Fix SQL syntax error

Download all attachments as: .zip

Change History (3)

@rittesh.patel
11 years ago

Fix SQL syntax error

#1 @boonebgorges
11 years ago

  • Milestone Awaiting Review2.4

Thanks for the patch!

#2 @boonebgorges
11 years ago

  • Owner set to boonebgorges
  • Resolutionfixed
  • Status newclosed

In 9985:

Fix SQL syntax error in BP_Friends_Friendship::search_friends().

Props rittesh.patel.
Fixes #6546.

Note: See TracTickets for help on using tickets.