Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/Service/FsEventService.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand Down Expand Up @@ -97,9 +99,11 @@ public function onDelete(Node $node, bool $recurse = true): void {
}

public function onInsert(Node $node, bool $recurse = true, bool $update = false): void {
if (!$this->allowedPath($node)) {
$user = $node->getOwner();
if (!$this->allowedPath($node) || $user === null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe the second allowedPath check below can be removed

return;
}
$userFolder = $this->rootFolder->getUserFolder($user->getUID());
if ($node instanceof Folder) {
if (!$recurse) {
return;
Expand All @@ -117,7 +121,7 @@ public function onInsert(Node $node, bool $recurse = true, bool $update = false)
}

foreach ($fileIds as $fileId) {
$file = current($this->rootFolder->getById($fileId));
$file = current($userFolder->getById($fileId));
if (!$file instanceof File) {
continue;
}
Expand Down
Loading