Review 13.4 Merged

89878[BUGFIX] Improve allowed MIME type handling, add vcf handling

Garvin Hicking CR +2 V +2 Easy +19 −4 updated 06/25/25, 13:57

Commit message

The mime-db collection requires .vcf files to have the
MIME type "text/x-vcard", but PHP's `finfo_file` or
`mime_content_type()` reports the MIME type as
"text/vcard", which is the actual RFC6350 recommendation.

With this patch, the MIME type "text/vcard" is added (patched) to
the list of mime-db JSON file containing the file-extension to
MIME-type assignments. This will allow .vcf files to be recognized
for both "text/vcard" (IANA/RFC) and "text/x-vcard" (Apache) variants.

An upstream issue [1] has been created so that ideally the hotfix
will not be required anymore at some point. Depending on that
outcome we might need an upgrade wizard that maps existing
"text/x-vcard" sys_file entries to "text/vcard".

Editor's note matching a sad trombone: Yes, this might happen for other
formats as they are revealed to us. Yes, there is no comprehensive
collection of every MIME type with a matching example files to
easily verify the outcome of PHP's MIME mapping to the db.json
structure.

Additionally, this patch adjusts the output message
for mismatching MIME types to contain the expected
type in the flash message output, so that integrators
can more easily adjust their configuration like this:

```
$GLOBALS['TYPO3_CONF_VARS']['SYS']['FileInfo']['mimeTypeCompatibility']
  [<reportedMIMEType>]
  [<fileExtension>] = <expectedMIMEType>;
```

[1] https://github.com/jshttp/mime-db/issues/388

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
  • Verified V +2 Done
    • Garvin Hicking +2
    • core-ci +1 CI

Issues 3

Files 4

Review log 34

  1. Garvin Hicking commented on patch set 1 06/25/25, 13:09

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 06/25/25, 13:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80860

  3. Garvin Hicking voted on patch set 1 CR +2 V +2 06/25/25, 13:57

  4. Garvin Hicking merged patch set 2 06/25/25, 13:57