From e3b9b0d29cfd301a8ba3f9af37e1080607dac6df Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Fri, 9 Oct 2020 14:57:45 +0200 Subject: [PATCH] Need to add `application/csv` to the list of valid CSV mime types --- src/PhpSpreadsheet/Reader/Csv.php | 2 +- tests/PhpSpreadsheetTests/Writer/Csv/CsvEnclosureTest.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/PhpSpreadsheet/Reader/Csv.php b/src/PhpSpreadsheet/Reader/Csv.php index 30b39a9b..d6eb16b0 100644 --- a/src/PhpSpreadsheet/Reader/Csv.php +++ b/src/PhpSpreadsheet/Reader/Csv.php @@ -522,8 +522,8 @@ class Csv extends BaseReader // Attempt to guess mimetype $type = mime_content_type($pFilename); - var_dump($type); $supportedTypes = [ + 'application/csv', 'text/csv', 'text/plain', 'inode/x-empty', diff --git a/tests/PhpSpreadsheetTests/Writer/Csv/CsvEnclosureTest.php b/tests/PhpSpreadsheetTests/Writer/Csv/CsvEnclosureTest.php index d4799356..d048183c 100644 --- a/tests/PhpSpreadsheetTests/Writer/Csv/CsvEnclosureTest.php +++ b/tests/PhpSpreadsheetTests/Writer/Csv/CsvEnclosureTest.php @@ -153,7 +153,6 @@ class CsvEnclosureTest extends Functional\AbstractFunctional $writer->save($filename); $filedata = file_get_contents($filename); $filedata = preg_replace('/\\r/', '', $filedata); - var_dump($filedata); $reader = new CsvReader(); $reader->setDelimiter($delimiter); $reader->setEnclosure($enclosure);