// 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) {
- $limit = 3;
- }
}
// TODO Optimize selects
if ($format == self::FORMAT_STATUSES) {
}
}
$root = strlen($root);
- $query = \OC_DB::prepare('SELECT '.$select.' FROM `*PREFIX*share` '.$where, $limit);
+ // 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));
$result = $query->execute($queryArgs);
$items = array();
$targets = array();