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:
Ferdinand Thiessen 2024-03-16 21:21:19 +01:00 committed by GitHub
commit 7773cbbe15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)