89779[BUGFIX] Improve allowed MIME type handling, add vcf handling
Commit message
Review
-
Code review CR +2 Done
- Garvin Hicking +2
- Benjamin Franzke +1
- Mogens Fiebrandt +1
- Oliver Hader +1
-
Verified V +2 Done
- Garvin Hicking +2
- Benjamin Franzke +1
- Mogens Fiebrandt +1
- Oliver Hader +1
- core-ci +1 CI
Issues 3
Files 4
Review log 1720
-
Garvin Hicking uploaded patch set 1 06/20/25, 12:33
-
core-ci voted on patch set 1 V +1 06/20/25, 12:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80529
-
Mogens Fiebrandt voted on patch set 1 CR +1 V +1 06/20/25, 14:36
-
Benjamin Franzke commented on patch set 1 06/23/25, 09:05
I do not understand why this patch is needed. When I apply the part of the DefaultConfiguration, the bug is already fixed and vcf can be uploaded. ``` + 'text/vcard' => [ + 'vcf' => 'text/x-vcard', ``` -
Benjamin Franzke commented on patch set 1 V -1 06/23/25, 09:07
Reply
btw, the forge issue used a wrong mapping, `[text/vcard']['vcf'] = 'text/vcard'`, it should have been `[text/vcard']['vcf'] = 'text/x-vcard'` as in your patch. -
Benjamin Franzke commented on patch set 1 06/23/25, 09:15
MimeTypeCompatibilityTypeGuesser.php:86The mapping `['text/plain']['vcf'] = 'text/x-vcard'` can coexist with `['text/vcard']['vcf'] = 'text/x-vcard'` as it allows both mime-types (`text/plain` and `text/vcard`) to be mapped to `text/x-vcard`). That means: No matter whether PHP/the server environment detects the `.vcf` as `text/plain` or as `text/vcard`, it will be mapped to `text/x-vcard`.ResourceConsistencyService.php:100I like ❤️ -
Garvin Hicking uploaded patch set 2
CR +1V +106/23/25, 14:25 -
Garvin Hicking commented on patch set 2 06/23/25, 14:29
MimeTypeCompatibilityTypeGuesser.php:86ReplyThanks. I think you're right. I was quite sure I initially tested it with the proper configuration from the forge issue (with proper identifier) and it didn't work without my lines. I tried to reproduce that and failed; it seems it all works without this change, so I removed it. I rephrased the commit message to try to point out that "mime-db" doesn't comply with the RFC in the vcf resolution. Do you know by chance what else is a mismatch of mime-db with source:apache and what PHP reports? I'm a bit afraid this will be a constant uphill battle to add mappings for file types, and each time we'll have to decide whether the file format is "common" or not to be included in the core....? -
core-ci voted on patch set 2 V +1 06/23/25, 14:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80625
-
Benjamin Franzke commented on patch set 2 06/23/25, 14:59
good, catch, I actually trusted mime-db which reports text/vcard to be .vcard only, which source "iana", but both iana and the respective RFC report vcf and vcard to be allowed: https://www.iana.org/assignments/media-types/text/vcard https://www.rfc-editor.org/rfc/rfc6350.html Seems like the mime-db regex fails to pick that up..: https://github.com/jshttp/mime-db/blob/master/scripts/fetch-iana.js#L31 So I think `.vcf` was nothing official, but since it is, we should rather not map to `text/x-vcard`, but either fix (or overwrite) mime-db. -
Garvin Hicking commented on patch set 2 06/23/25, 16:00
Reply
Rabbit hole :-) I just filed it here: https://github.com/jshttp/mime-db/issues/388 -
Garvin Hicking uploaded patch set 3
V +106/23/25, 16:15 -
core-ci voted on patch set 3 V +1 06/23/25, 16:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80644
-
Benjamin Franzke commented on patch set 3 CR +1 V +1 06/23/25, 20:37
Reply
thanks!MimeTypeCompatibilityTypeGuesser.php:86ReplyI don't know about other mismatches and as we've seens, this is more than just a mismatch, but an upstream bug. Thx for reporting and supplying the fix. -
Mogens Fiebrandt voted on patch set 3 CR +1 V +1 06/24/25, 23:28
-
Oliver Hader voted on patch set 3 CR +1 V +1 06/25/25, 11:40
-
Oliver Hader commented on patch set 3 06/25/25, 11:40
In addition: Should `vcf` be added as default to the `textfile_ext` list? -
Garvin Hicking voted on patch set 3 CR +2 V +2 06/25/25, 13:09
-
Garvin Hicking commented on patch set 3 06/25/25, 13:56
Reply
(Note, we've talked about this - textfile_ext is already not a full list of supported allowed MIME types and would need alignment if it ever gets enforced by default. For now we'll try to have the list leaner with more common uploaded files) -
Garvin Hicking merged patch set 4 06/25/25, 13:57