[Pkg-owncloud-commits] [owncloud] 15/73: Fix OC_Connector_Sabre_Locks for SQLite

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


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

taffit pushed a commit to annotated tag v4.0.10
in repository owncloud.

commit 6d94455540781950b063b39385324ffe90f702c3
Author: Jakob Sack <mail at jakobsack.de>
Date:   Sun Aug 12 09:06:46 2012 +0200

    Fix OC_Connector_Sabre_Locks for SQLite
---
 lib/connector/sabre/locks.php |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/connector/sabre/locks.php b/lib/connector/sabre/locks.php
index 94382e6..3fabfcf 100644
--- a/lib/connector/sabre/locks.php
+++ b/lib/connector/sabre/locks.php
@@ -41,8 +41,10 @@ class OC_Connector_Sabre_Locks extends Sabre_DAV_Locks_Backend_Abstract {
 		// NOTE: the following 10 lines or so could be easily replaced by
 		// pure sql. MySQL's non-standard string concatination prevents us
 		// from doing this though.
-		$query = 'SELECT * FROM *PREFIX*locks WHERE userid = ? AND (created + timeout) > ? AND ((uri = ?)';
-		$params = array(OC_User::getUser(),time(),$uri);
+		// Fix: sqlite does not insert time() as a number but as text, making
+		// the equation returning false all the time
+		$query = 'SELECT * FROM *PREFIX*locks WHERE userid = ? AND (created + timeout) > '.time().' AND ((uri = ?)';
+		$params = array(OC_User::getUser(),$uri);
 
 		// We need to check locks for every part in the uri.
 		$uriParts = explode('/',$uri);

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