diff options
-rw-r--r-- | lib/connector/sabre/file.php | 6 | ||||
-rwxr-xr-x | lib/request.php | 12 |
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/connector/sabre/file.php b/lib/connector/sabre/file.php index 521c5f0571d..63c581f30c9 100644 --- a/lib/connector/sabre/file.php +++ b/lib/connector/sabre/file.php @@ -52,6 +52,12 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D // rename to correct path \OC\Files\Filesystem::rename($partpath, $this->path); + + //allow sync clients to send the mtime along in a header + $mtime = OC_Request::hasModificationTime(); + if ($mtime !== false) { + \OC\Files\Filesystem::touch($this->path,$mtime); + } return OC_Connector_Sabre_Node::getETagPropertyForPath($this->path); } diff --git a/lib/request.php b/lib/request.php index 1661a1406ca..3c668b02c5f 100755 --- a/lib/request.php +++ b/lib/request.php @@ -149,4 +149,16 @@ class OC_Request { return 'gzip'; return false; } + + /** + * @brief Check if the requester sent along an mtime + * @returns false or an mtime + */ + static public function hasModificationTime () { + if (isset($_SERVER['HTTP_X_OC_MTIME'])) { + return $_SERVER['HTTP_X_OC_MTIME']; + } else { + return false; + } + } } |