summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2023-06-21 20:07:00 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2023-07-07 17:56:01 +0200
commit2c162694f27e1b57a3b49f1c128242793fbbc894 (patch)
tree0421c50d07bb2de1a8fb93d2cc05f85f24875d1a
parent9f549013b00fdf937619d2bf9b47d6c20d7522f1 (diff)
downloadnextcloud-server-2c162694f27e1b57a3b49f1c128242793fbbc894.tar.gz
nextcloud-server-2c162694f27e1b57a3b49f1c128242793fbbc894.zip
fix: use array_unitersect against objects
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
-rw-r--r--apps/dav/lib/Connector/Sabre/FilesReportPlugin.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php
index a828f873086..1b66dee1896 100644
--- a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php
@@ -30,6 +30,7 @@ namespace OCA\DAV\Connector\Sabre;
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;
@@ -238,7 +239,9 @@ class FilesReportPlugin extends ServerPlugin {
// 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;
}
@@ -344,7 +347,7 @@ class FilesReportPlugin extends ServerPlugin {
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();
});
}