Merge pull request #2654 from Kdecherf/domain-filter

Enforce lowercase on domain name filter
This commit is contained in:
Jeremy Benoist 2016-11-27 18:35:38 +01:00 committed by GitHub
commit 5b644798a0
2 changed files with 10 additions and 1 deletions

View file

@ -90,7 +90,7 @@ class EntryFilterType extends AbstractType
if (strlen($value) <= 2 || empty($value)) {
return;
}
$expression = $filterQuery->getExpr()->like($field, $filterQuery->getExpr()->literal('%'.$value.'%'));
$expression = $filterQuery->getExpr()->like($field, $filterQuery->getExpr()->lower($filterQuery->getExpr()->literal('%'.$value.'%')));
return $filterQuery->createCondition($expression);
},

View file

@ -725,6 +725,15 @@ class EntryControllerTest extends WallabagCoreTestCase
$crawler = $client->submit($form, $data);
$this->assertCount(5, $crawler->filter('div[class=entry]'));
$crawler = $client->request('GET', '/unread/list');
$form = $crawler->filter('button[id=submit-filter]')->form();
$data = [
'entry_filter[domainName]' => 'dOmain',
];
$crawler = $client->submit($form, $data);
$this->assertCount(5, $crawler->filter('div[class=entry]'));
$form = $crawler->filter('button[id=submit-filter]')->form();
$data = [
'entry_filter[domainName]' => 'wallabag',