aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/share.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/share.php')
-rw-r--r--lib/public/share.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/public/share.php b/lib/public/share.php
index c74960b94c5..7722e0b86cc 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -756,7 +756,7 @@ class Share {
$collectionItems = array();
foreach ($items as &$row) {
// Return only the item instead of a 2-dimensional array
- if ($limit == 1 && $row['item_type'] == $itemType && $row[$column] == $item) {
+ if ($limit == 1 && $row[$column] == $item && ($row['item_type'] == $itemType || $itemType == 'file')) {
if ($format == self::FORMAT_NONE) {
return $row;
} else {
@@ -823,6 +823,9 @@ class Share {
if (!empty($collectionItems)) {
$items = array_merge($items, $collectionItems);
}
+ if (empty($items) && $limit == 1) {
+ return false;
+ }
if ($format == self::FORMAT_NONE) {
return $items;
} else if ($format == self::FORMAT_STATUSES) {