[Pkg-owncloud-commits] [owncloud] 09/63: define escape character for like statements on sqlite

David Prévot taffit at moszumanska.debian.org
Tue Dec 22 16:50:47 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8.0
in repository owncloud.

commit 2993a741cfe67c20280e87bc5b4056b30a82feba
Author: Robin Appelman <icewind at owncloud.com>
Date:   Thu May 28 16:16:59 2015 +0200

    define escape character for like statements on sqlite
---
 lib/private/db/adaptersqlite.php | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/private/db/adaptersqlite.php b/lib/private/db/adaptersqlite.php
index a910696..cc0e9e8 100644
--- a/lib/private/db/adaptersqlite.php
+++ b/lib/private/db/adaptersqlite.php
@@ -11,6 +11,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 );

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list