From bed9ce2d1897d6af3f2ec1cf1b351486b1ad2fb1 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 20 May 2014 08:26:55 -0700 Subject: [PATCH] Make PeopleQuery throw, not select everything, when handed empty array Summary: Make `->withPHIDs(array())` throw on this query instead of selecting everything. Test Plan: Poked around. Reviewers: btrahan, chad Reviewed By: chad Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D9210 --- .../people/query/PhabricatorPeopleQuery.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/applications/people/query/PhabricatorPeopleQuery.php b/src/applications/people/query/PhabricatorPeopleQuery.php index cd323d8f66..f1ec4376e8 100644 --- a/src/applications/people/query/PhabricatorPeopleQuery.php +++ b/src/applications/people/query/PhabricatorPeopleQuery.php @@ -200,35 +200,35 @@ final class PhabricatorPeopleQuery private function buildWhereClause($conn_r) { $where = array(); - if ($this->usernames) { + if ($this->usernames !== null) { $where[] = qsprintf( $conn_r, 'user.userName IN (%Ls)', $this->usernames); } - if ($this->emails) { + if ($this->emails !== null) { $where[] = qsprintf( $conn_r, 'email.address IN (%Ls)', $this->emails); } - if ($this->realnames) { + if ($this->realnames !== null) { $where[] = qsprintf( $conn_r, 'user.realName IN (%Ls)', $this->realnames); } - if ($this->phids) { + if ($this->phids !== null) { $where[] = qsprintf( $conn_r, 'user.phid IN (%Ls)', $this->phids); } - if ($this->ids) { + if ($this->ids !== null) { $where[] = qsprintf( $conn_r, 'user.id IN (%Ld)', -- 2.51.2