[php-src] Issue #11891: fileinfo returns text/xml for some svg files
| From: | ostrolucky | Date: | Sun, 06 Aug 2023 10:10:06 +0000 |
| Subject: | [php-src] Issue #11891: fileinfo returns text/xml for some svg files | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-245112@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/11891
Author: ostrolucky
### Description
The following code:
```php
<?php
echo (new \finfo(\FILEINFO_MIME_TYPE))->file('svgfile.svg');
```
Resulted in this output:
```
text/xml
```
But I expected this output instead:
```
image/svg+xml
```
Here are example files:


I've reported same bug for
file command line utility and they fixed it quickly: https://bugs.astron.com/view.php?id=470 (but I
don't know how does the fix look like, I failed finding source code for their HEAD version)
### PHP Version
8.2.8
### Operating System
MacOS, Ubuntu