diff --git a/lib/ACL/ACLManager.php b/lib/ACL/ACLManager.php index c35e6d92a..f5ddfd80e 100644 --- a/lib/ACL/ACLManager.php +++ b/lib/ACL/ACLManager.php @@ -106,7 +106,12 @@ private function getRelevantPaths(string $path): array { $fromTrashbin = str_starts_with($path, '__groupfolders/trash/'); if ($fromTrashbin) { /* Exploded path will look like ["__groupfolders", "trash", "1", "folderName.d2345678", "rest/of/the/path.txt"] */ - [,,$groupFolderId,$rootTrashedItemName] = explode('/', $path, 5); + $parts = explode('/', $path, 5); + if (count($parts) < 4) { + // path is the root of the groupfolder trash + return []; + } + [, , $groupFolderId, $rootTrashedItemName] = $parts; $groupFolderId = (int)$groupFolderId; /* Remove the date part */ $separatorPos = strrpos($rootTrashedItemName, '.d');