Review main Abandoned

89492[TASK] Update MimeTypeCollection for .csv => text/plain compatibility

Garvin Hicking CR 0 V 0 Normal +67 −1 updated 05/23/25, 06:39

Commit message

Recognize ".csv" files that are detected as text/plain by
finfo_file()/mime_type_info() instead of text/csv to be allowed to be
uploaded with the MIME type hardening added in #106240.

Executed commands:
> cd Build && nvm use && npm update mime-db
> Scripts/generateMimeTypes.php

Review

  • Code review CR 0
  • Verified V 0

Issues 2

Files 3

Review log 1619

  1. Garvin Hicking uploaded patch set 1 05/20/25, 21:11

  2. core-ci voted on patch set 1 V +1 05/20/25, 21:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79256

  3. Garvin Hicking commented on patch set 1 V -1 05/20/25, 21:50

    only preparation, I did not yet test this and if it fixes all of tbe reported issue.
  4. Albrecht Köhnlein commented on patch set 1 05/21/25, 06:13

    MimeTypeCollection.php:938

    I guess, this line should be removed.
  5. Garvin Hicking commented on patch set 1 05/21/25, 06:19

    MimeTypeCollection.php:938 Reply

    if I understood correctly, some servers might actually use this mimetype, as this is also the "official" one to my understanding?!
  6. Albrecht Köhnlein commented on patch set 1 05/21/25, 06:23

    MimeTypeCollection.php:938 Reply

  7. Oliver Hader uploaded patch set 2 V +1 05/21/25, 06:55

  8. Oliver Hader commented on patch set 2 CR +1 V +1 05/21/25, 06:57

    Tested with FAL Status in reports module.
  9. core-ci voted on patch set 2 V +1 05/21/25, 07:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79272

  10. Benjamin Franzke commented on patch set 2 05/21/25, 07:29

    generateMimeTypes.php:37

    I kind of stumble over this comment: What refers "default" to here? I guess to the value that `finfo_file()`/`mime_content_type()` resolves (which is "text/plain")? But why do your refer to that as "default", is there something else than default? Also "Enhance" sounds wrong, is there a case where CSV is properly detected as `text/csv`?
  11. Albrecht Köhnlein commented on patch set 2 V +1 05/21/25, 07:39

    Tested in TYPO3 13 and 12 and it works as expected
  12. Benjamin Franzke voted on patch set 2 V +1 05/21/25, 07:46

  13. Oliver Hader commented on patch set 2 05/21/25, 07:48

    generateMimeTypes.php:37 Reply

    Good point. I think this comment should be changed e.g. simply `allowing text/plain for cvs files as well`. Since CSV files don't have a proper file header, they always would be resolved to `text/plain`. However, when sending a file (in an HTTP response), using `text/csv` is more accurate. Thus, both types are fine, depending on the usage.
  14. Benjamin Franzke uploaded patch set 3 CR +1 V +1 05/21/25, 08:12

  15. core-ci voted on patch set 3 V +1 05/21/25, 08:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79276

  16. Garvin Hicking commented on patch set 3 05/21/25, 09:09

    generateMimeTypes.php:37 Reply Unresolved

    thanks for these great improvements, lgtm!
  17. Garvin Hicking commented on patch set 3 V -1 05/21/25, 09:38

    Unresolved

    see comments in https://forge.typo3.org/issues/106735#change-543454 - I think we'll need to address more MIME dupes?!
  18. Benjamin Franzke voted on patch set 3 CR 0 V 0 05/22/25, 07:24

  19. Garvin Hicking abandoned the change 05/23/25, 06:39

    I think this is not a good approach and would need way too many entries. We should move forward with alternate approaches that are being investigated. thus, closing this for now.