Skip to content

Commit eb90a54

Browse files
IONOS(Movie): Thumbnail: prevent downloading large files from non-local storage
Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
1 parent b0aa905 commit eb90a54

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

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)