|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-07-01 12:48 UTC] mamontovdmitriy at mail dot ru
[2020-07-01 13:31 UTC] cmb@php.net
[2020-07-01 13:39 UTC] edi dot modric at gmail dot com
[2020-07-01 14:10 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
-Assigned To:
+Assigned To: cmb
[2020-07-01 14:10 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 05:00:01 2025 UTC |
Description: ------------ Using the following JSON document: { "foo": [] } finfo::file method wrongly returns text/plain as mime type instead of application/json. Modifying the JSON document to e.g.: { "foo": ["bar"] } makes the function behave correctly and returns application/json. Test script: --------------- <?php $finfo = new finfo(FILEINFO_MIME_TYPE); echo $finfo->file('file.json') . PHP_EOL; Expected result: ---------------- With the following content of file.json: { "foo": [] } I expect to see "application/json" as the output. Actual result: -------------- With the following content of file.json: { "foo": [] } "text/plain" is returned.