Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get only vcards which match both the address book id and the vcard uri #25294

Merged
merged 1 commit into from Jun 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/dav/lib/CardDAV/CardDavBackend.php
Expand Up @@ -848,7 +848,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 @@ -606,6 +606,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