mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-18 21:02:41 +01:00
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
This commit is contained in:
parent
481a295454
commit
bed9ce2d18
1 changed files with 5 additions and 5 deletions
|
@ -200,35 +200,35 @@ final class PhabricatorPeopleQuery
|
||||||
private function buildWhereClause($conn_r) {
|
private function buildWhereClause($conn_r) {
|
||||||
$where = array();
|
$where = array();
|
||||||
|
|
||||||
if ($this->usernames) {
|
if ($this->usernames !== null) {
|
||||||
$where[] = qsprintf(
|
$where[] = qsprintf(
|
||||||
$conn_r,
|
$conn_r,
|
||||||
'user.userName IN (%Ls)',
|
'user.userName IN (%Ls)',
|
||||||
$this->usernames);
|
$this->usernames);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->emails) {
|
if ($this->emails !== null) {
|
||||||
$where[] = qsprintf(
|
$where[] = qsprintf(
|
||||||
$conn_r,
|
$conn_r,
|
||||||
'email.address IN (%Ls)',
|
'email.address IN (%Ls)',
|
||||||
$this->emails);
|
$this->emails);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->realnames) {
|
if ($this->realnames !== null) {
|
||||||
$where[] = qsprintf(
|
$where[] = qsprintf(
|
||||||
$conn_r,
|
$conn_r,
|
||||||
'user.realName IN (%Ls)',
|
'user.realName IN (%Ls)',
|
||||||
$this->realnames);
|
$this->realnames);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->phids) {
|
if ($this->phids !== null) {
|
||||||
$where[] = qsprintf(
|
$where[] = qsprintf(
|
||||||
$conn_r,
|
$conn_r,
|
||||||
'user.phid IN (%Ls)',
|
'user.phid IN (%Ls)',
|
||||||
$this->phids);
|
$this->phids);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->ids) {
|
if ($this->ids !== null) {
|
||||||
$where[] = qsprintf(
|
$where[] = qsprintf(
|
||||||
$conn_r,
|
$conn_r,
|
||||||
'user.id IN (%Ld)',
|
'user.id IN (%Ld)',
|
||||||
|
|
Loading…
Reference in a new issue