diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2014-02-26 15:52:35 +0400 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2014-02-26 17:49:41 +0400 |
commit | ac3f1d6f61fcdb9e9602cc0d7fd521a10757fdb7 (patch) | |
tree | 4e61284911ca8efd6be3f1a56bd46df377dcc156 /apps/files_sharing | |
parent | d27f2929d27776c8afac017f6502a8669af192a9 (diff) |
only add "received_from" if a share was found
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/lib/api.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/files_sharing/lib/api.php b/apps/files_sharing/lib/api.php index 061e60ad8ed..7a3e25ef995 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); } } |