-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fileinfo returns text/xml for some svg files #11891
Comments
All because of unicode format, any And it doesn't look like it's a mistake |
This seems to be fixed upstream |
Which upstream? Does this mean this will be fixed in next PHP patch version? |
@ostrolucky fixed upstream file/file@006b37f |
@ostrolucky You can use a patched file https://raw.githubusercontent.com/file/file/master/magic/Magdir/sgml <?php
echo (new \finfo(\FILEINFO_MIME_TYPE, 'sgml'))->file('svgfile.svg'); |
I don't know what @weltling's process is for updating the bundled library, but he seems to apply fixes onto stable releases, but the last syncing was done on the 1st of July. Part of the process is described here: #11298 (comment) so if someone wants to make a PR. |
Made a backport, not sure if I sent it correctly pull request.. |
[ci skip] Signed-off-by: Anatol Belski <ab@php.net>
* PHP-8.1: NEWS: Added note about #11891
[ci skip] Signed-off-by: Anatol Belski <ab@php.net>
[ci skip] Signed-off-by: Anatol Belski <ab@php.net>
Fixed via #11943. Thanks |
Description
The following code:
Resulted in this output:
But I expected this output instead:
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
The text was updated successfully, but these errors were encountered: