[Pkg-owncloud-commits] [owncloud] 24/75: fix now() function for sqlite3

David Prévot taffit at alioth.debian.org
Fri Nov 8 23:08:32 UTC 2013


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

taffit pushed a commit to annotated tag v3.0.1
in repository owncloud.

commit 6361eb8d246083a2d75de8f54120cb8cc73513df
Author: Robin Appelman <icewind1991 at gmail.com>
Date:   Mon Oct 17 00:24:42 2011 +0200

    fix now() function for sqlite3
---
 lib/db.php |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/db.php b/lib/db.php
index ede8ba8..a99b255 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -312,9 +312,8 @@ class OC_DB {
 		$query = str_replace( 'NOW()', self::$DBConnection->now(), $query );
 		$query = str_replace( 'now()', self::$DBConnection->now(), $query );
 		
-		// differences in escaping of table names (` for mysql)
-		// Problem: what if there is a ` in the value we want to insert?
-		if( $CONFIG_DBTYPE == 'sqlite' ){
+		// differences in escaping of table names ('`' for mysql) and getting the current timestamp
+		if( $type == 'sqlite' || $type == 'sqlite3' ){
 			$query = str_replace( '`', '\'', $query );
 		}
 		elseif( $CONFIG_DBTYPE == 'pgsql' ){

-- 
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