summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2014-02-26 12:52:35 +0100
committerBjoern Schiessle <schiessle@owncloud.com>2014-02-26 12:52:35 +0100
commit3be5e48b0c255012667c0ba1f334970f62b789a6 (patch)
tree659f3a3d47a38ded581da00010f0da7a8b82dee5
parent59df3ffdf4647fcff1996017723af8c5eca72522 (diff)
downloadnextcloud-server-3be5e48b0c255012667c0ba1f334970f62b789a6.tar.gz
nextcloud-server-3be5e48b0c255012667c0ba1f334970f62b789a6.zip
only add "received_from" 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);
}
}