Skip to:

Opened 5 years ago

Closed 5 years ago

#8040 closed defect (bug) (fixed)

`BP_User_Query` should ignore empty `exclude`

Reported by: boonebgorges's profile boonebgorges Owned by: boonebgorges's profile boonebgorges
Milestone: 5.0.0 Priority: normal
Severity: normal Version:
Component: Core Keywords: good-first-bug has-patch


If you pass an empty array (or empty string, or some other falsey value other than false) to the 'exclude' param of BP_User_Query, you end up with malformed SQL. See

This check should be less strict. Empty arrays, in particular, should result in the NOT IN clause being skipped. This is semantically correct ("exclude no one") and is also consistent with the behavior of include.

Attachments (1)

8040.diff (539 bytes) - added by espellcaste 5 years ago.

Download all attachments as: .zip

Change History (3)

5 years ago

#1 @espellcaste
5 years ago

  • Keywords has-patch added; needs-patch removed

@boonebgorges I added a patch to fix it.

#2 @boonebgorges
5 years ago

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

In 12329:

User query: Ignore falsey values of exclude.

Props espellcaste.
Fixes #8040.

Note: See TracTickets for help on using tickets.