[Pkg-owncloud-commits] [owncloud] 102/239: Fixed ext storage touch function to return true on success

David Prévot taffit at moszumanska.debian.org
Fri Nov 29 01:32:24 UTC 2013


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

taffit pushed a commit to branch master
in repository owncloud.

commit d88025bf6b1d8b146605da6c518c4af9624394a4
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Mon Nov 25 12:44:27 2013 +0100

    Fixed ext storage touch function to return true on success
    
    Some ext storage impl didn't return true on success.
    
    Fixes #5943 (Dropbox)
    Fixes #6010 (WebDAV)
---
 apps/files_external/lib/dropbox.php | 6 +++++-
 apps/files_external/lib/swift.php   | 4 ++--
 apps/files_external/lib/webdav.php  | 1 +
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/apps/files_external/lib/dropbox.php b/apps/files_external/lib/dropbox.php
index 6e464f4..5f603b7 100755
--- a/apps/files_external/lib/dropbox.php
+++ b/apps/files_external/lib/dropbox.php
@@ -269,7 +269,11 @@ class Dropbox extends \OC\Files\Storage\Common {
 	}
 
 	public function touch($path, $mtime = null) {
-		return false;
+		if ($this->file_exists($path)) {
+			return false;
+		} else {
+			$this->file_put_contents($path, '');
+		}
 	}
 
 }
diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php
index 86938ef..b615d24 100644
--- a/apps/files_external/lib/swift.php
+++ b/apps/files_external/lib/swift.php
@@ -364,7 +364,7 @@ class Swift extends \OC\Files\Storage\Common {
 					'X-Object-Meta-Timestamp' => $mtime
 				)
 			);
-			$object->Update($settings);
+			return $object->Update($settings);
 		} else {
 			$object = $this->container->DataObject();
 			if (is_null($mtime)) {
@@ -377,7 +377,7 @@ class Swift extends \OC\Files\Storage\Common {
 					'X-Object-Meta-Timestamp' => $mtime
 				)
 			);
-			$object->Create($settings);
+			return $object->Create($settings);
 		}
 	}
 
diff --git a/apps/files_external/lib/webdav.php b/apps/files_external/lib/webdav.php
index 0837222..02f6cb5 100644
--- a/apps/files_external/lib/webdav.php
+++ b/apps/files_external/lib/webdav.php
@@ -234,6 +234,7 @@ class DAV extends \OC\Files\Storage\Common{
 		} else {
 			$this->file_put_contents($path, '');
 		}
+		return true;
 	}
 
 	public function getFile($path, $target) {

-- 
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