[buddypress-trac] [BuddyPress Trac] #8040: `BP_User_Query` should ignore empty `exclude`

buddypress-trac noreply at wordpress.org
Wed Jan 23 16:05:48 UTC 2019


#8040: `BP_User_Query` should ignore empty `exclude`
--------------------------+----------------------------------------
 Reporter:  boonebgorges  |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  5.0.0
Component:  Core          |    Version:
 Severity:  normal        |   Keywords:  needs-patch good-first-bug
--------------------------+----------------------------------------
 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`.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8040>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list