Case insensitive search in contacts - fixes #22575

This commit is contained in:
Thomas Müller 2016-02-22 19:47:10 +01:00
parent 4537eaac41
commit 4dfdb2720c
2 changed files with 3 additions and 3 deletions

View File

@ -776,7 +776,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
$query2->orWhere(
$query2->expr()->andX(
$query2->expr()->eq('cp.name', $query->createNamedParameter($property)),
$query2->expr()->like('cp.value', $query->createNamedParameter('%' . $this->db->escapeLikeParameter($pattern) . '%'))
$query2->expr()->ilike('cp.value', $query->createNamedParameter('%' . $this->db->escapeLikeParameter($pattern) . '%'))
)
);
}

View File

@ -547,8 +547,8 @@ class CardDavBackendTest extends TestCase {
['John', ['FN'], ['John Doe', 'John M. Doe']],
['M. Doe', ['FN'], ['John M. Doe']],
['Do', ['FN'], ['John Doe', 'John M. Doe']],
// check if duplicates are handled correctly
['John', ['FN', 'CLOUD'], ['John Doe', 'John M. Doe']],
'check if duplicates are handled correctly' => ['John', ['FN', 'CLOUD'], ['John Doe', 'John M. Doe']],
'case insensitive' => ['john', ['FN'], ['John Doe', 'John M. Doe']]
];
}