summaryrefslogtreecommitdiffstats
path: root/lib/connector
diff options
context:
space:
mode:
authorJakob Sack <mail@jakobsack.de>2012-08-12 09:06:46 +0200
committerJörn Friedrich Dreyer <jfd@butonic.de>2012-08-24 15:00:52 +0200
commit1dfa6f3d8fd45e45ebd28a745106d3bd6153e6ae (patch)
treee72af3685662a7eac4a47e9090a15408f2d3afcc /lib/connector
parent78e8cbd52cd42d1ece5ff0a47177495ad30a8e23 (diff)
downloadnextcloud-server-1dfa6f3d8fd45e45ebd28a745106d3bd6153e6ae.tar.gz
nextcloud-server-1dfa6f3d8fd45e45ebd28a745106d3bd6153e6ae.zip
Fix OC_Connector_Sabre_Locks for SQLite
Diffstat (limited to 'lib/connector')
-rw-r--r--lib/connector/sabre/locks.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/connector/sabre/locks.php b/lib/connector/sabre/locks.php
index b4878fabc78..a12f2a54406 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);