mirror of
https://github.com/nextcloud/server.git
synced 2026-03-04 14:31:03 -05:00
Merge pull request #44247 from nextcloud/backport/43613/stable27
[stable27] fix: fallback from guessing the owner from path in versioning
This commit is contained in:
commit
7773cbbe15
1 changed files with 10 additions and 0 deletions
|
|
@ -361,6 +361,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