Skip to content

Commit fc8aae7

Browse files
committed
bug #32986 [Mime] fixed wrong mimetype (rjwebdev)
This PR was squashed before being merged into the 4.3 branch (closes #32986). Discussion ---------- [Mime] fixed wrong mimetype | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #32816 | License | MIT When creating a datapart from an odt file (and some other extensions), the explode function for the picked mimetype gives a wrong result since there's no `application/` prefix for the first mimetype of this extension. In this PR, all mimetypes without a prefix are removed. Commits ------- e1722c529a [Mime] fixed wrong mimetype
2 parents 524dce4 + 9a61388 commit fc8aae7

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

MimeTypes.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2433,12 +2433,12 @@ public function guessMimeType(string $path): ?string
24332433
'odc' => ['application/vnd.oasis.opendocument.chart'],
24342434
'odf' => ['application/vnd.oasis.opendocument.formula'],
24352435
'odft' => ['application/vnd.oasis.opendocument.formula-template'],
2436-
'odg' => ['vnd.oasis.opendocument.graphics', 'application/vnd.oasis.opendocument.graphics'],
2436+
'odg' => ['application/vnd.oasis.opendocument.graphics'],
24372437
'odi' => ['application/vnd.oasis.opendocument.image'],
24382438
'odm' => ['application/vnd.oasis.opendocument.text-master'],
2439-
'odp' => ['vnd.oasis.opendocument.presentation', 'application/vnd.oasis.opendocument.presentation'],
2440-
'ods' => ['vnd.oasis.opendocument.spreadsheet', 'application/vnd.oasis.opendocument.spreadsheet'],
2441-
'odt' => ['vnd.oasis.opendocument.text', 'application/vnd.oasis.opendocument.text'],
2439+
'odp' => ['application/vnd.oasis.opendocument.presentation'],
2440+
'ods' => ['application/vnd.oasis.opendocument.spreadsheet'],
2441+
'odt' => ['application/vnd.oasis.opendocument.text'],
24422442
'oga' => ['audio/ogg', 'audio/vorbis', 'audio/x-flac+ogg', 'audio/x-ogg', 'audio/x-oggflac', 'audio/x-speex+ogg', 'audio/x-vorbis', 'audio/x-vorbis+ogg'],
24432443
'ogg' => ['audio/ogg', 'audio/vorbis', 'audio/x-flac+ogg', 'audio/x-ogg', 'audio/x-oggflac', 'audio/x-speex+ogg', 'audio/x-vorbis', 'audio/x-vorbis+ogg', 'video/ogg', 'video/x-ogg', 'video/x-theora', 'video/x-theora+ogg'],
24442444
'ogm' => ['video/x-ogm', 'video/x-ogm+ogg'],

Resources/bin/update_mime_types.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,6 @@
108108
'mp4' => ['video/mp4'],
109109
'mpeg' => ['video/mpeg'],
110110
'mpg' => ['video/mpeg'],
111-
'odg' => ['vnd.oasis.opendocument.graphics'],
112-
'odp' => ['vnd.oasis.opendocument.presentation'],
113-
'ods' => ['vnd.oasis.opendocument.spreadsheet'],
114-
'odt' => ['vnd.oasis.opendocument.text'],
115111
'ogg' => ['audio/ogg'],
116112
'pdf' => ['application/pdf'],
117113
'php' => ['application/x-php'],

0 commit comments

Comments
 (0)