]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Enforce lowercase on domain name filter 2654/head
authorKevin Decherf <kevin@kdecherf.com>
Sat, 26 Nov 2016 18:52:50 +0000 (19:52 +0100)
committerKevin Decherf <kevin@kdecherf.com>
Sat, 26 Nov 2016 18:52:50 +0000 (19:52 +0100)
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php

index 7b02f85c35e336671d3ee19f87f22ef8be677aec..ee66c728a88558cd21511076782418ef62674ab3 100644 (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);
                 },
index 952e895741d84350e4cdcd8245169d396ba79683..c347cca5ad2ab05ba2acb3783fa432fd2ad13307 100644 (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',