diff options
author | Jakob Sack <mail@jakobsack.de> | 2012-07-31 23:31:25 +0200 |
---|---|---|
committer | Jakob Sack <mail@jakobsack.de> | 2012-07-31 23:31:25 +0200 |
commit | 1fe9892292ec9934742b99dea0f831b3a5637d25 (patch) | |
tree | 7e7ac65eaa489050ab547c09aa2a80f1fb49a21b /lib | |
parent | 36ccaf51ed548e1afb7819493142532623c17e69 (diff) | |
download | nextcloud-server-1fe9892292ec9934742b99dea0f831b3a5637d25.tar.gz nextcloud-server-1fe9892292ec9934742b99dea0f831b3a5637d25.zip |
Fix #476
Diffstat (limited to 'lib')
-rw-r--r-- | lib/connector/sabre/locks.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/connector/sabre/locks.php b/lib/connector/sabre/locks.php index e95dcf02d27..1db4fc09446 100644 --- a/lib/connector/sabre/locks.php +++ b/lib/connector/sabre/locks.php @@ -41,8 +41,11 @@ 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); + // NOTE: SQLite requires time() to be inserted directly. That's ugly + // but otherwise reading locks from SQLite Databases will return + // nothing + $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); @@ -70,8 +73,8 @@ class OC_Connector_Sabre_Locks extends Sabre_DAV_Locks_Backend_Abstract { } $query.=')'; - $stmt = OC_DB::prepare($query); - $result = $stmt->execute($params); + $stmt = OC_DB::prepare($query ); + $result = $stmt->execute( $params ); $lockList = array(); while( $row = $result->fetchRow()){ |