From 29782bbf83b91883a18dab3972cf440ad4bbebd1 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Tue, 27 Jan 2026 08:07:20 +0100 Subject: [PATCH] fix(DAV): Fix getFileFromAbsoluteUri Signed-off-by: provokateurin --- lib/Service/FileService.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/Service/FileService.php b/lib/Service/FileService.php index 67b2ebc9..0cc9214c 100644 --- a/lib/Service/FileService.php +++ b/lib/Service/FileService.php @@ -130,7 +130,14 @@ public function getFileFromUri(string $uri): Node { * @throws NoUserException */ public function getFileFromAbsoluteUri(string $uri): Node { - [$root, $userId, $path] = explode('/', trim($uri, '/') . '/', 3); + $user = $this->userSession->getUser(); + if ($user === null) { + throw new SessionNotAvailableException(); + } + + $userId = $user->getUID(); + + [$root, , $path] = explode('/', trim($uri, '/') . '/', 3); if ($root !== 'files') { throw new NotFoundException(); }