From 67b1ec1fafaa4ca4d4343b7a3867d194509cb633 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 17 Sep 2014 13:47:55 +0200 Subject: [PATCH] Implement ILIKE for sqlite --- lib/private/db/adaptersqlite.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/db/adaptersqlite.php b/lib/private/db/adaptersqlite.php index 06cdb7aab05..3471fcf4042 100644 --- a/lib/private/db/adaptersqlite.php +++ b/lib/private/db/adaptersqlite.php @@ -11,7 +11,7 @@ namespace OC\DB; class AdapterSqlite extends Adapter { public function fixupStatement($statement) { - $statement = str_replace(' ILIKE ', ' LIKE ', $statement); + $statement = preg_replace('/`(\w+)` ILIKE \?/', 'LOWER($1) LIKE LOWER(?)', $statement); $statement = str_replace( '`', '"', $statement ); $statement = str_ireplace( 'NOW()', 'datetime(\'now\')', $statement ); $statement = str_ireplace( 'UNIX_TIMESTAMP()', 'strftime(\'%s\',\'now\')', $statement ); -- 2.39.5