From b394fe87092f9e5355d4ee7502fed437f0266b1f Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 28 May 2015 16:16:59 +0200 Subject: define escape character for like statements on sqlite --- lib/private/db/adaptersqlite.php | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/private') diff --git a/lib/private/db/adaptersqlite.php b/lib/private/db/adaptersqlite.php index 5add0586da0..e133a20f543 100644 --- a/lib/private/db/adaptersqlite.php +++ b/lib/private/db/adaptersqlite.php @@ -28,6 +28,7 @@ namespace OC\DB; class AdapterSqlite extends Adapter { public function fixupStatement($statement) { + $statement = preg_replace('( I?LIKE \?)', '$0 ESCAPE \'\\\'', $statement); $statement = preg_replace('/`(\w+)` ILIKE \?/', 'LOWER($1) LIKE LOWER(?)', $statement); $statement = str_replace( '`', '"', $statement ); $statement = str_ireplace( 'NOW()', 'datetime(\'now\')', $statement ); -- cgit v1.2.3