Merge pull request #54267 from nextcloud/backport/54266/stable30

[stable30] fix(lib): get fileinfo before locking
This commit is contained in:
Ferdinand Thiessen 2025-08-06 11:26:45 +02:00 committed by GitHub
commit 6c4460f3e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -109,7 +109,6 @@ class OC_Files {
}
}
self::lockFiles($view, $dir, $files);
$numberOfFiles = 0;
$fileSize = 0;
@ -132,7 +131,11 @@ class OC_Files {
}
}
//Dispatch an event to see if any apps have problem with download
// Lock the files AFTER we retrieved the files infos
// this allows us to ensure they're still available
self::lockFiles($view, $dir, $files);
// Dispatch an event to see if any apps have problem with download
$event = new BeforeZipCreatedEvent($dir, is_array($files) ? $files : [$files]);
$dispatcher = \OCP\Server::get(IEventDispatcher::class);
$dispatcher->dispatchTyped($event);