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
This commit is contained in:
Fabien Potencier 2019-08-07 12:03:35 +02:00
commit a3aaaa16e9
2 changed files with 4 additions and 8 deletions

View File

@ -2433,12 +2433,12 @@ final class MimeTypes implements MimeTypesInterface
'odc' => ['application/vnd.oasis.opendocument.chart'],
'odf' => ['application/vnd.oasis.opendocument.formula'],
'odft' => ['application/vnd.oasis.opendocument.formula-template'],
'odg' => ['vnd.oasis.opendocument.graphics', 'application/vnd.oasis.opendocument.graphics'],
'odg' => ['application/vnd.oasis.opendocument.graphics'],
'odi' => ['application/vnd.oasis.opendocument.image'],
'odm' => ['application/vnd.oasis.opendocument.text-master'],
'odp' => ['vnd.oasis.opendocument.presentation', 'application/vnd.oasis.opendocument.presentation'],
'ods' => ['vnd.oasis.opendocument.spreadsheet', 'application/vnd.oasis.opendocument.spreadsheet'],
'odt' => ['vnd.oasis.opendocument.text', 'application/vnd.oasis.opendocument.text'],
'odp' => ['application/vnd.oasis.opendocument.presentation'],
'ods' => ['application/vnd.oasis.opendocument.spreadsheet'],
'odt' => ['application/vnd.oasis.opendocument.text'],
'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'],
'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'],
'ogm' => ['video/x-ogm', 'video/x-ogm+ogg'],

View File

@ -108,10 +108,6 @@ $exts = [
'mp4' => ['video/mp4'],
'mpeg' => ['video/mpeg'],
'mpg' => ['video/mpeg'],
'odg' => ['vnd.oasis.opendocument.graphics'],
'odp' => ['vnd.oasis.opendocument.presentation'],
'ods' => ['vnd.oasis.opendocument.spreadsheet'],
'odt' => ['vnd.oasis.opendocument.text'],
'ogg' => ['audio/ogg'],
'pdf' => ['application/pdf'],
'php' => ['application/x-php'],