Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly look up filename when logged in but inaccessible #48295

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
7 changes: 4 additions & 3 deletions apps/files_versions/lib/Listener/FileEventsListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,10 @@ private function getPathForNode(Node $node): ?string {

$owner = $node->getOwner()?->getUid();

// If no owner, extract it from the path.
// e.g. /user/files/foobar.txt
if (!$owner) {
// If no owner, extract it from the path, e.g. /user/files/foobar.txt
// Also try this if they are the same, because it might be a group folder that the user does not have access to
// E.g. where filling in a form with a spreadsheet attached
if (!$owner || $owner == $user) {
$parts = explode('/', $node->getPath(), 4);
if (count($parts) === 4) {
$owner = $parts[1];
Expand Down