Skip to content

Commit 6c4460f

Browse files
authored
Merge pull request #54267 from nextcloud/backport/54266/stable30
[stable30] fix(lib): get fileinfo before locking
2 parents 2672301 + 55e9491 commit 6c4460f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

lib/private/legacy/OC_Files.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ public static function get($dir, $files, $params = null) {
109109
}
110110
}
111111

112-
self::lockFiles($view, $dir, $files);
113112
$numberOfFiles = 0;
114113
$fileSize = 0;
115114

@@ -132,7 +131,11 @@ public static function get($dir, $files, $params = null) {
132131
}
133132
}
134133

135-
//Dispatch an event to see if any apps have problem with download
134+
// Lock the files AFTER we retrieved the files infos
135+
// this allows us to ensure they're still available
136+
self::lockFiles($view, $dir, $files);
137+
138+
// Dispatch an event to see if any apps have problem with download
136139
$event = new BeforeZipCreatedEvent($dir, is_array($files) ? $files : [$files]);
137140
$dispatcher = \OCP\Server::get(IEventDispatcher::class);
138141
$dispatcher->dispatchTyped($event);

0 commit comments

Comments
 (0)