Merge pull request #58815 from nextcloud/s32ValidatePrevMime

fix(preview): Validate preview MIME type
This commit is contained in:
Git'Fellow 2026-03-20 11:25:24 +01:00 committed by GitHub
commit 8d397818a3
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 {