fix sharing bug introduced with oracle support

This commit is contained in:
jfd 2012-08-26 14:57:33 +02:00
parent 80374c7cb2
commit 9822cd30c0

View file

@ -516,10 +516,6 @@ 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) {
$limit = 3;
}
}
// TODO Optimize selects
if ($format == self::FORMAT_STATUSES) {
@ -548,7 +544,8 @@ class Share {
}
}
$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();