Skip to content

Commit 9131942

Browse files
IONOS(Movie): Thumbnail: prevent downloading large files from non-local storage
Signed-off-by: Misha M.-Kupriyanov <[email protected]>
1 parent dc0a733 commit 9131942

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/private/Preview/Movie.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage {
6868
// in some cases this doesn't work for example when the moov atom is at the
6969
// end of the file, so if it fails we fall back to getting the full file
7070
$sizeAttempts = [5242880, null];
71+
72+
// do not attempt to download the file if the storage is not local (e.g. S3)
73+
// We don't want to download the whole (e.g. 37Gb) file
74+
if (!$file->getStorage()->isLocal()) {
75+
$sizeAttempts = [5242880];
76+
}
7177
} else {
7278
// size is irrelevant, only attempt once
7379
$sizeAttempts = [null];

0 commit comments

Comments
 (0)