[php-src] Issue #11544: finfo_file returns wrong mime type for csv file
| From: | oleg-andreyev | Date: | Mon, 26 Jun 2023 22:19:00 +0000 |
| Subject: | [php-src] Issue #11544: finfo_file returns wrong mime type for csv file | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-244822@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/11544
Author: oleg-andreyev
### Description
**This issue is for the sake of awareness!**
upstream issue https://bugs.astron.com/view.php?id=463
----
The following code:
```php
<?php
$path = __DIR__ . '/test.csv';
$finfo = finfo_file(finfo_open(FILEINFO_NONE), $path);
var_dump($finfo);
$path = __DIR__ . '/test2.csv';
$finfo = finfo_file(finfo_open(FILEINFO_NONE), $path);
var_dump($finfo);
```
Resulted in this output:
```
❯ php test.php
string(10) "ASCII text"
string(8) "CSV text"
```
But I expected this output instead:
```
❯ php test.php
string(8) "CSV text"
string(8) "CSV text"
```
[test.csv](https://github.com/php/php-src/files/11875038/test.csv)
[test2.csv](https://github.com/php/php-src/files/11875039/test2.csv)
### PHP Version
8.2.6
### Operating System
_No response_