diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-05-28 16:16:59 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-11-05 16:28:54 +0100 |
commit | b394fe87092f9e5355d4ee7502fed437f0266b1f (patch) | |
tree | 10d3bf81234d8f0cf99d896c2ff8ff12e6f48524 | |
parent | 236c3c62ccf494c9cd652559b2ac06690ec10656 (diff) | |
download | nextcloud-server-b394fe87092f9e5355d4ee7502fed437f0266b1f.tar.gz nextcloud-server-b394fe87092f9e5355d4ee7502fed437f0266b1f.zip |
define escape character for like statements on sqlite
-rw-r--r-- | lib/private/db/adaptersqlite.php | 1 |
1 files changed, 1 insertions, 0 deletions
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 ); |