Skip to content

Commit

Permalink
fix: use array_unitersect against objects
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
  • Loading branch information
blizzz committed Jun 21, 2023
1 parent 27f6f86 commit a0b6834
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apps/dav/lib/Connector/Sabre/FilesReportPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
use OC\Files\View;
use OCP\App\IAppManager;
use OCP\Files\Folder;
use OCP\Files\Node as INode;
use OCP\IGroupManager;
use OCP\ITagManager;
use OCP\IUserSession;
Expand Down Expand Up @@ -238,7 +239,9 @@ public function onReport($reportName, $report, $uri) {
// find sabre nodes by file id, restricted to the root node path
$additionalNodes = $this->findNodesByFileIds($reportTargetNode, $resultFileIds);
if ($additionalNodes && $results) {
$results = array_intersect($results, $additionalNodes);
$results = array_uintersect($results, $additionalNodes, function (Node $a, Node $b): int {
return $a->getId() - $b->getId();
});
} elseif (!$results && $additionalNodes) {
$results = $additionalNodes;
}
Expand Down Expand Up @@ -344,7 +347,7 @@ protected function processFilterRulesForFileNodes(array $filterRules, ?int $limi
if (count($nodes) === 0) {
$nodes = $tmpNodes;
} else {
$nodes = array_uintersect($nodes, $tmpNodes, function (\OCP\Files\Node $a, \OCP\Files\Node $b): int {
$nodes = array_uintersect($nodes, $tmpNodes, function (INode $a, INode $b): int {
return $a->getId() - $b->getId();
});
}
Expand Down

0 comments on commit a0b6834

Please sign in to comment.