summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-09-19 16:52:44 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2013-09-19 16:52:44 +0200
commit39920955f25f7b7f04395324b886d361725436ed (patch)
tree63a61a39845756faadafe430ba7da2f53bba2564 /apps
parentc9f1538c1f5d9f950da77c869d16b3dfec8e46d8 (diff)
downloadnextcloud-server-39920955f25f7b7f04395324b886d361725436ed.tar.gz
nextcloud-server-39920955f25f7b7f04395324b886d361725436ed.zip
set share id to 'unknown' if we can't retrive one
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib/api.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/apps/files_sharing/lib/api.php b/apps/files_sharing/lib/api.php
index 06da492ba15..3aa87b6e1d1 100644
--- a/apps/files_sharing/lib/api.php
+++ b/apps/files_sharing/lib/api.php
@@ -182,25 +182,24 @@ class Api {
}
if ($token) {
- $data = null;
+ $data = array();
+ $data['id'] = 'unknown';
$shares = \OCP\Share::getItemShared('file', $itemSource);
if(is_string($token)) { //public link share
foreach ($shares as $share) {
if ($share['token'] === $token) {
- $shareId = $share['id'];
+ $data['id'] = $share['id'];
break;
}
}
$url = \OCP\Util::linkToPublic('files&t='.$token);
- $data = array('url' => $url, // '&' gets encoded to $amp;
- 'token' => $token,
- 'id' => $shareId);
+ $data['url'] = $url; // '&' gets encoded to $amp;
+ $data['token'] = $token;
} else {
foreach ($shares as $share) {
if ($share['share_with'] === $shareWith && $share['share_type'] === $shareType) {
- $shareId = $share['id'];
- $data = array('id' => $shareId);
+ $data['id'] = $share['id'];
break;
}
}