fix(previex): Validate preview MIME type

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
This commit is contained in:
Git'Fellow 2026-03-09 18:25:26 +01:00 committed by GitHub
parent 50f27f3d89
commit 1d932cfa4a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -535,6 +535,9 @@ class Generator {
self::unguardWithSemaphore($sem);
}
if (!$preview->valid() || $preview->dataMimeType() === null) {
throw new \InvalidArgumentException('Preview generation failed: invalid or null MIME type');
}
$path = $this->generatePath($width, $height, $crop, false, $preview->dataMimeType(), $prefix);
try {