[php-src] Issue #8805: finfo returns wrong mime type for woff/woff2 files
| From: | kojot1234 | Date: | Thu, 16 Jun 2022 16:53:08 +0000 |
| Subject: | [php-src] Issue #8805: finfo returns wrong mime type for woff/woff2 files | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-241746@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8805
Author: kojot1234
### Description
Uploaded woff/woff2 return incorrect mime type.
The following code:
```php
// $path is a content of an uploaded woff or woff2 file
$finfo = new \finfo(\FILEINFO_MIME_TYPE));
$mimeType = $finfo->file($path); // returns "application/octet-stream"
echo $mimeType;
```
Resulted in this output:
```
returns "application/octet-stream"
```
But I expected this output instead:
```
expected result is: "font/woff"
```
Mime type has been fixed in libmagic/file in version 5.42.
https://github.com/file/file/commit/7a821aedc144f70ec848ea632a64db74b79563c1
### PHP Version
8.1.7
### Operating System
Alpine 3.16