Opened 6 years ago
Closed 6 years ago
#8040 closed defect (bug) (fixed)
`BP_User_Query` should ignore empty `exclude`
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.0.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Core | Keywords: | good-first-bug has-patch |
Cc: |
Description ¶
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 https://buddypress.trac.wordpress.org/browser/tags/4.1.0/src/bp-core/classes/class-bp-user-query.php?marks=377#L376
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
.
Commits (1)
- [12329] User query: Ignore falsey values of
exclude
.… by @boonebgorges 6 years ago
Pull Requests
- Loading…
Note: See
TracTickets for help on using
tickets.
@boonebgorges I added a patch to fix it.