Skip to:
Content

BuddyPress.org

Opened 9 years ago

Closed 9 years ago

#6546 closed defect (bug) (fixed)

SQL syntax error in BP_Friends_Friendship::search_friends function

Reported by: ritteshpatel's profile rittesh.patel Owned by: boonebgorges's profile boonebgorges
Milestone: 2.4 Priority: high
Severity: normal Version: 2.3.2
Component: Friends 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 9 years ago.
Fix SQL syntax error

Download all attachments as: .zip

Change History (3)

@rittesh.patel
9 years ago

Fix SQL syntax error

#1 @boonebgorges
9 years ago

  • Milestone changed from Awaiting Review to 2.4

Thanks for the patch!

#2 @boonebgorges
9 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

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.