[Pkg-owncloud-commits] [owncloud] 10/44: only add "received_from" if a share was found

David Prévot taffit at moszumanska.debian.org
Fri Mar 7 13:27:23 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 ac3f1d6f61fcdb9e9602cc0d7fd521a10757fdb7
Author: Bjoern Schiessle <schiessle at owncloud.com>
Date:   Wed Feb 26 12:52:35 2014 +0100

    only add "received_from" if a share was found
---
 apps/files_sharing/lib/api.php | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/apps/files_sharing/lib/api.php b/apps/files_sharing/lib/api.php
index 061e60a..7a3e25e 100644
--- a/apps/files_sharing/lib/api.php
+++ b/apps/files_sharing/lib/api.php
@@ -172,12 +172,12 @@ class Api {
 			// workaround because folders are named 'dir' in this context
 			$itemType = $file['type'] === 'file' ? 'file' : 'folder';
 			$share = \OCP\Share::getItemShared($itemType, $file['fileid']);
-			$receivedFrom =  \OCP\Share::getItemSharedWithBySource($itemType, $file['fileid']);
-			if ($receivedFrom) {
-				$share['received_from'] = $receivedFrom['uid_owner'];
-				$share['received_from_displayname'] = \OCP\User::getDisplayName($receivedFrom['uid_owner']);
-			}
-			if ($share) {
+			if($share) {
+				$receivedFrom =  \OCP\Share::getItemSharedWithBySource($itemType, $file['fileid']);
+				if ($receivedFrom) {
+					$share['received_from'] = $receivedFrom['uid_owner'];
+					$share['received_from_displayname'] = \OCP\User::getDisplayName($receivedFrom['uid_owner']);
+				}
 				$result = array_merge($result, $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