diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2023-06-21 20:07:00 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2023-07-06 21:52:52 +0200 |
commit | 653812d5836677fcf328ca8ec4410d43b473ab57 (patch) | |
tree | 53a24c25fb2ab41077d36271fbf4011bb8436f88 /apps/dav/lib/Connector | |
parent | a5a134567b61c03eb3e0fdbf93957b78a60124d4 (diff) | |
download | nextcloud-server-653812d5836677fcf328ca8ec4410d43b473ab57.tar.gz nextcloud-server-653812d5836677fcf328ca8ec4410d43b473ab57.zip |
fix: use array_unitersect against objects
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/dav/lib/Connector')
-rw-r--r-- | apps/dav/lib/Connector/Sabre/FilesReportPlugin.php | 7 |
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(); }); } |