Skip to content

Commit

Permalink
bug #32986 [Mime] fixed wrong mimetype (rjwebdev)
Browse files Browse the repository at this point in the history
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
-------

e1722c5 [Mime] fixed wrong mimetype
  • Loading branch information
fabpot committed Aug 7, 2019
2 parents 3cd7726 + e1722c5 commit a3aaaa1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/Symfony/Component/Mime/MimeTypes.php
Expand Up @@ -2433,12 +2433,12 @@ public function guessMimeType(string $path): ?string
'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'],
Expand Down
Expand Up @@ -108,10 +108,6 @@
'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'],
Expand Down

0 comments on commit a3aaaa1

Please sign in to comment.