aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-02-26 14:42:31 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2014-02-26 14:42:31 +0100
commit4b8717df9dc09bd097fec032fdc607b648e73e38 (patch)
tree7839089282bfb5b5b964ea24b3afb6970e5fefa1
parentd9a153dbe91a775be533869b4d80ddaa33609ca8 (diff)
parent3be5e48b0c255012667c0ba1f334970f62b789a6 (diff)
downloadnextcloud-server-4b8717df9dc09bd097fec032fdc607b648e73e38.tar.gz
nextcloud-server-4b8717df9dc09bd097fec032fdc607b648e73e38.zip
Merge pull request #7416 from owncloud/share_api_7311
[share api] only add "received_from" field if a share was found
-rw-r--r--apps/files_sharing/lib/api.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/files_sharing/lib/api.php b/apps/files_sharing/lib/api.php
index 19a2d22b068..0ba58aa896a 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);
}
}