diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-04-15 20:03:00 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-04-15 20:03:00 +0200 |
commit | c82adb8c5db01d6a49c4364f7eecb2931f59cfa1 (patch) | |
tree | 2c18fa58b47ff03aa3f872a1c13c0b2fe4968fed /lib/private/connector | |
parent | 371a924c92bb751b81e2a819d8c581743be7a797 (diff) | |
parent | 2eeab60378a3e22e19c4f435aa2bf65cc9da7c2a (diff) | |
download | nextcloud-server-c82adb8c5db01d6a49c4364f7eecb2931f59cfa1.tar.gz nextcloud-server-c82adb8c5db01d6a49c4364f7eecb2931f59cfa1.zip |
merge master into webdav-injection
Diffstat (limited to 'lib/private/connector')
-rw-r--r-- | lib/private/connector/sabre/node.php | 9 | ||||
-rw-r--r-- | lib/private/connector/sabre/quotaplugin.php | 11 |
2 files changed, 17 insertions, 3 deletions
diff --git a/lib/private/connector/sabre/node.php b/lib/private/connector/sabre/node.php index 3a5c721dda5..55e626c4c85 100644 --- a/lib/private/connector/sabre/node.php +++ b/lib/private/connector/sabre/node.php @@ -115,11 +115,14 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr /** * @brief Returns the last modification time, as a unix timestamp - * @return int + * @return int timestamp as integer */ public function getLastModified() { - return $this->info->getMtime(); - + $timestamp = $this->info->getMtime(); + if (!empty($timestamp)) { + return (int)$timestamp; + } + return $timestamp; } /** diff --git a/lib/private/connector/sabre/quotaplugin.php b/lib/private/connector/sabre/quotaplugin.php index 13fb187eed3..78d3172725a 100644 --- a/lib/private/connector/sabre/quotaplugin.php +++ b/lib/private/connector/sabre/quotaplugin.php @@ -61,8 +61,19 @@ class OC_Connector_Sabre_QuotaPlugin extends Sabre_DAV_ServerPlugin { $uri = '/' . $uri; } list($parentUri, $newName) = Sabre_DAV_URLUtil::splitPath($uri); + $req = $this->server->httpRequest; + if ($req->getHeader('OC-Chunked')) { + $info = OC_FileChunking::decodeName($newName); + $chunkHandler = new OC_FileChunking($info); + // substract the already uploaded size to see whether + // there is still enough space for the remaining chunks + $length -= $chunkHandler->getCurrentSize(); + } $freeSpace = $this->getFreeSpace($parentUri); if ($freeSpace !== \OC\Files\SPACE_UNKNOWN && $length > $freeSpace) { + if (isset($chunkHandler)) { + $chunkHandler->cleanup(); + } throw new Sabre_DAV_Exception_InsufficientStorage(); } } |