From 6d1651452f59dfa1e8defca9b37496bc5f07f36c Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 21 Apr 2017 20:40:13 +0200 Subject: Add back the name query part Signed-off-by: Roeland Jago Douma --- apps/dav/lib/CardDAV/CardDavBackend.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'apps/dav') diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php index 65b8176aed4..e7f0a1090be 100644 --- a/apps/dav/lib/CardDAV/CardDavBackend.php +++ b/apps/dav/lib/CardDAV/CardDavBackend.php @@ -872,9 +872,11 @@ class CardDavBackend implements BackendInterface, SyncSupport { $query2->selectDistinct('cp.cardid')->from($this->dbCardsPropertiesTable, 'cp'); $query2->andWhere($query2->expr()->eq('cp.addressbookid', $query->createNamedParameter($addressBookId))); + $or = $query2->expr()->orX(); foreach ($searchProperties as $property) { - $query2->expr()->orX($query2->expr()->eq('cp.name', $query->createNamedParameter($property))); + $or->add($query2->expr()->eq('cp.name', $query->createNamedParameter($property))); } + $query2->andWhere($or); $query2->andWhere($query2->expr()->ilike('cp.value', $query->createNamedParameter('%' . $this->db->escapeLikeParameter($pattern) . '%'))); $query->select('c.carddata', 'c.uri')->from($this->dbCardsTable, 'c') -- cgit v1.2.3