Fix share getItems() limit
This commit is contained in:
parent
c33a2ca01d
commit
18517f6adb
1 changed files with 9 additions and 2 deletions
|
@ -516,6 +516,14 @@ class Share {
|
|||
// If the limit is not 1, the filtering can be done later
|
||||
$where .= ' ORDER BY `*PREFIX*share`.`id` DESC';
|
||||
}
|
||||
// The limit must be at least 3, because filtering needs to be done
|
||||
if ($limit < 3) {
|
||||
$queryLimit = 3;
|
||||
} else {
|
||||
$queryLimit = $limit;
|
||||
}
|
||||
} else {
|
||||
$queryLimit = null;
|
||||
}
|
||||
// TODO Optimize selects
|
||||
if ($format == self::FORMAT_STATUSES) {
|
||||
|
@ -544,8 +552,7 @@ class Share {
|
|||
}
|
||||
}
|
||||
$root = strlen($root);
|
||||
// The limit must be at least 3, because filtering needs to be done
|
||||
$query = \OC_DB::prepare('SELECT '.$select.' FROM `*PREFIX*share` '.$where, ($limit < 3 ? 3 : $limit));
|
||||
$query = \OC_DB::prepare('SELECT '.$select.' FROM `*PREFIX*share` '.$where, $queryLimit);
|
||||
$result = $query->execute($queryArgs);
|
||||
$items = array();
|
||||
$targets = array();
|
||||
|
|
Loading…
Reference in a new issue