Skip to content

Commit 55e9491

Browse files
skjnldsvbackportbot[bot]
authored andcommitted
fix(lib): get fileinfo before locking
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
1 parent 13a0fc8 commit 55e9491

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)