]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix sharing bug introduced with oracle support
authorjfd <jfd@lance>
Sun, 26 Aug 2012 12:57:33 +0000 (14:57 +0200)
committerjfd <jfd@lance>
Sun, 26 Aug 2012 12:57:33 +0000 (14:57 +0200)
lib/public/share.php

index 93820760d1586a3b2805228a45871790cfbbbc5c..070d69d05ae1bbac9da7829d73dbe3ad7f21f5ad 100644 (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();