[Pkg-owncloud-commits] [owncloud] 04/14: adding special handling of checkPrecondition() for chunked upload

David Prévot taffit at moszumanska.debian.org
Wed Jul 23 16:23:07 UTC 2014


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

taffit pushed a commit to branch master
in repository owncloud.

commit 61d99672216aa5972c4d852619ec6835a43ca97f
Author: Thomas Müller <thomas.mueller at tmit.eu>
Date:   Tue Jul 22 13:06:20 2014 +0200

    adding special handling of checkPrecondition() for chunked upload
---
 lib/private/connector/sabre/server.php | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/lib/private/connector/sabre/server.php b/lib/private/connector/sabre/server.php
index e4ee5dc..aaf4fe8 100644
--- a/lib/private/connector/sabre/server.php
+++ b/lib/private/connector/sabre/server.php
@@ -29,6 +29,37 @@
 class OC_Connector_Sabre_Server extends Sabre\DAV\Server {
 
 	/**
+	 * @var string
+	 */
+	private $overLoadedUri = null;
+
+	public function getRequestUri() {
+
+		if (!is_null($this->overLoadedUri)) {
+			return $this->overLoadedUri;
+		}
+
+		return parent::getRequestUri();
+	}
+
+	public function checkPreconditions($handleAsGET = false) {
+		// chunked upload handling
+		if (isset($_SERVER['HTTP_OC_CHUNKED'])) {
+			$filePath = parent::getRequestUri();
+			list($path, $name) = \Sabre\DAV\URLUtil::splitPath($filePath);
+			$info = OC_FileChunking::decodeName($name);
+			if (!empty($info)) {
+				$filePath = $path . '/' . $info['name'];
+				$this->overLoadedUri = $filePath;
+			}
+		}
+
+		$result = parent::checkPreconditions($handleAsGET);
+		$this->overLoadedUri = null;
+		return $result;
+	}
+
+	/**
 	 * @see \Sabre\DAV\Server
 	 */
 	protected function httpPropfind($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