Skip to content
Merged
Show file tree
Hide file tree
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
fix: Properly check for array of authenticated share ids
Signed-off-by: Julius Knorr <[email protected]>
  • Loading branch information
juliusknorr committed Dec 3, 2025
commit 475de4e980d19cf2ba7b9f573792e48025bc27d6
4 changes: 2 additions & 2 deletions lib/Controller/WorkspaceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ public function publicFolder(string $shareToken, string $path = '/'): DataRespon
}
/** @psalm-suppress RedundantConditionGivenDocblockType */
if ($share->getPassword() !== null) {
$shareId = $this->session->get('public_link_authenticated');
if ($share->getId() !== $shareId) {
$shareIds = $this->session->get('public_link_authenticated');
if ($share->getId() !== $shareIds && (is_array($shareIds) && !in_array($share->getId(), $shareIds, true))) {
throw new ShareNotFound();
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Middleware/SessionMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ private function assertUserOrShareToken(ISessionAwareController $controller): vo
}

if ($share->getPassword() !== null) {
$shareId = $this->session->get('public_link_authenticated');
if ($share->getId() !== $shareId) {
$shareIds = $this->session->get('public_link_authenticated');
if ($share->getId() !== $shareIds && (is_array($shareIds) && !in_array($share->getId(), $shareIds, true))) {
throw new InvalidSessionException();
}
}
Expand Down
Loading