- Issue created by @JonMcL
It appears that the csv_mimedetector (\Drupal\mimedetect\Plugin\MimeDetector\CsvMimeDetector) plugin will return 'text/csv' for at least some files that are not CSV files.
I know this module is not exactly being maintained anymore, but I thought I'd create this issue so that others can benefit.
We need a better method to detect CSV files, or the plugin should be removed in favor of PHP file info or the UNIX File command. Those methods are reliably detecting that the included basic.hta_.csv file is not in fact a CSV file.
For our web apps, we are using hook_mime_detector_info_alter to remove the plugin:
function mymodule_mime_detector_info_alter(array &$info) {
if (isset($info['csv_mimedetector'])) {
unset($info['csv_mimedetector']);
}
}
Active
1.0
Code