diff --git a/EMS/common-bundle/src/Helper/MimeTypeHelper.php b/EMS/common-bundle/src/Helper/MimeTypeHelper.php index 593ebc1d9..b7fd87a88 100644 --- a/EMS/common-bundle/src/Helper/MimeTypeHelper.php +++ b/EMS/common-bundle/src/Helper/MimeTypeHelper.php @@ -30,7 +30,7 @@ public static function getInstance(): self public function guessMimeType(string $filename): string { $mimeType = $this->mimeTypes->guessMimeType($filename); - if (self::TEXT_PLAIN === $mimeType) { + if (\str_starts_with($mimeType ?? '', 'text/')) { $ext = \pathinfo($filename, PATHINFO_EXTENSION); $mimeType = $this->mimeTypes->getMimeTypes($ext)[0] ?? $mimeType; }