mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #43613 from nextcloud/version-owner-fallback
This commit is contained in:
commit
2ff172004a
1 changed files with 10 additions and 0 deletions
|
|
@ -362,6 +362,16 @@ class FileEventsListener implements IEventListener {
|
|||
}
|
||||
|
||||
$owner = $node->getOwner()?->getUid();
|
||||
|
||||
// If no owner, extract it from the path.
|
||||
// e.g. /user/files/foobar.txt
|
||||
if (!$owner) {
|
||||
$parts = explode('/', $node->getPath(), 4);
|
||||
if (count($parts) === 4) {
|
||||
$owner = $parts[1];
|
||||
}
|
||||
}
|
||||
|
||||
if ($owner) {
|
||||
$path = $this->rootFolder
|
||||
->getUserFolder($owner)
|
||||
|
|
|
|||
Loading…
Reference in a new issue