summaryrefslogtreecommitdiffstats
path: root/apps/dav
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2016-02-09 12:07:30 +0100
committerJoas Schilling <nickvergessen@owncloud.com>2016-02-09 12:07:30 +0100
commite8d9c288bcc6ace78177426b7a9647d1e317d371 (patch)
tree2b0eeaf8d0092f2c2daeacefd6086a4ffcdd368c /apps/dav
parent178914104c494a40b078638396bc9fdb511806ab (diff)
downloadnextcloud-server-e8d9c288bcc6ace78177426b7a9647d1e317d371.tar.gz
nextcloud-server-e8d9c288bcc6ace78177426b7a9647d1e317d371.zip
Stop when a mid result is empty
Diffstat (limited to 'apps/dav')
-rw-r--r--apps/dav/lib/connector/sabre/filesreportplugin.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/dav/lib/connector/sabre/filesreportplugin.php b/apps/dav/lib/connector/sabre/filesreportplugin.php
index d7e4f8beda1..141b684360e 100644
--- a/apps/dav/lib/connector/sabre/filesreportplugin.php
+++ b/apps/dav/lib/connector/sabre/filesreportplugin.php
@@ -211,7 +211,7 @@ class FilesReportPlugin extends ServerPlugin {
*/
public function processFilterRules($filterRules) {
$ns = '{' . $this::NS_OWNCLOUD . '}';
- $resultFileIds = [];
+ $resultFileIds = null;
$systemTagIds = [];
foreach ($filterRules as $filterRule) {
if ($filterRule['name'] === $ns . 'systemtag') {
@@ -240,15 +240,21 @@ class FilesReportPlugin extends ServerPlugin {
$fileIds = $this->tagMapper->getObjectIdsForTags($systemTagId, 'files');
if (empty($fileIds)) {
+ // This tag has no files, nothing can ever show up
return [];
}
// first run ?
- if (empty($resultFileIds)) {
+ if ($resultFileIds === null) {
$resultFileIds = $fileIds;
} else {
$resultFileIds = array_intersect($resultFileIds, $fileIds);
}
+
+ if (empty($resultFileIds)) {
+ // Empty intersection, nothing can show up anymore
+ return [];
+ }
}
return $resultFileIds;
}