Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
get only vcards which match both the address book id and the vcard uri (
  • Loading branch information
schiessle authored and DeepDiver1975 committed Jun 29, 2016
1 parent 735411d commit 1f71285
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/dav/lib/carddav/carddavbackend.php
Expand Up @@ -845,7 +845,7 @@ public function getContact($addressBookId, $uri) {
$query = $this->db->getQueryBuilder();
$query->select('*')->from($this->dbCardsTable)
->where($query->expr()->eq('uri', $query->createNamedParameter($uri)))
->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)));
->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)));
$queryResult = $query->execute();
$contact = $queryResult->fetch();
$queryResult->closeCursor();
Expand Down
4 changes: 4 additions & 0 deletions apps/dav/tests/unit/carddav/carddavbackendtest.php
Expand Up @@ -605,6 +605,10 @@ public function testGetContact() {
$this->assertSame(5489543, (int)$result['lastmodified']);
$this->assertSame('etag0', $result['etag']);
$this->assertSame(120, (int)$result['size']);

// this shouldn't return any result because 'uri1' is in address book 1
$result = $this->backend->getContact(0, 'uri1');
$this->assertEmpty($result);
}

public function testGetContactFail() {
Expand Down

0 comments on commit 1f71285

Please sign in to comment.