diff options
Diffstat (limited to 'lib/private/Files/Cache/QuerySearchHelper.php')
-rw-r--r-- | lib/private/Files/Cache/QuerySearchHelper.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/private/Files/Cache/QuerySearchHelper.php b/lib/private/Files/Cache/QuerySearchHelper.php index 2d9d8f374f7..47380b72ffa 100644 --- a/lib/private/Files/Cache/QuerySearchHelper.php +++ b/lib/private/Files/Cache/QuerySearchHelper.php @@ -88,14 +88,18 @@ class QuerySearchHelper { * @param ISearchOperator $operator */ public function searchOperatorArrayToDBExprArray(IQueryBuilder $builder, array $operators) { - return array_map(function ($operator) use ($builder) { + return array_filter(array_map(function ($operator) use ($builder) { return $this->searchOperatorToDBExpr($builder, $operator); - }, $operators); + }, $operators)); } public function searchOperatorToDBExpr(IQueryBuilder $builder, ISearchOperator $operator) { $expr = $builder->expr(); if ($operator instanceof ISearchBinaryOperator) { + if (count($operator->getArguments()) === 0) { + return null; + } + switch ($operator->getType()) { case ISearchBinaryOperator::OPERATOR_NOT: $negativeOperator = $operator->getArguments()[0]; |