aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CardDAV
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2017-04-21 20:40:13 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2017-04-21 20:43:40 +0200
commit6d1651452f59dfa1e8defca9b37496bc5f07f36c (patch)
tree0c9b286fddd0683268fa0d2e8ba4934cc42c8ce6 /apps/dav/lib/CardDAV
parentecba3722da8b2bcb4987acb13c9bbe912f8e711e (diff)
downloadnextcloud-server-6d1651452f59dfa1e8defca9b37496bc5f07f36c.tar.gz
nextcloud-server-6d1651452f59dfa1e8defca9b37496bc5f07f36c.zip
Add back the name query part
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/dav/lib/CardDAV')
-rw-r--r--apps/dav/lib/CardDAV/CardDavBackend.php4
1 files changed, 3 insertions, 1 deletions
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')