[Pkg-owncloud-commits] [owncloud] 167/199: Fixed warning when file_target is not set

David Prévot taffit at moszumanska.debian.org
Sun Jun 1 18:53:22 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 7fac2b62e954b0f8a693516da1151c97efa2ee99
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Fri May 30 12:35:04 2014 +0200

    Fixed warning when file_target is not set
    
    In some cases (like in the unit tests) "file_target" is not set yet
    whenever the target file system hasn't been mounted yet.
---
 apps/files_sharing/lib/api.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/apps/files_sharing/lib/api.php b/apps/files_sharing/lib/api.php
index ff56c46..dc4e5cf 100644
--- a/apps/files_sharing/lib/api.php
+++ b/apps/files_sharing/lib/api.php
@@ -58,7 +58,9 @@ class Api {
 			return new \OC_OCS_Result(null, 404, 'could not get shares');
 		} else {
 			foreach ($shares as &$share) {
-				if ($share['item_type'] === 'file') {
+				// file_target might not be set if the target user hasn't mounted
+				// the filesystem yet
+				if ($share['item_type'] === 'file' && isset($share['file_target'])) {
 					$share['mimetype'] = \OC_Helper::getFileNameMimeType($share['file_target']);
 				}
 				$newShares[] = $share;

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