Bug #75380 [Opn->Fbk]: finfo_file treats XML file as text/xml

From: Date: Thu, 26 Oct 2017 16:29:42 +0000
Subject: Bug #75380 [Opn->Fbk]: finfo_file treats XML file as text/xml
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212331@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75380&edit=1 ID: 75380 Updated by: ab@php.net Reported by: d dot naumenko dot a at gmail dot com Summary: finfo_file treats XML file as text/xml -Status: Open +Status: Feedback Type: Bug Package: Filesystem function related Operating System: 3v4l PHP Version: 7.2.0RC4 Block user comment: N Private report: N New Comment: Thanks for the report. Why is it supposed to be a bug? Seems the behavior is intentional https://github.com/file/file/commit/cee2b49cdb6c995c1a449aa399f80145e28c6a8a in the upstream data. Also wrt RFC 7303 the types are same. The data version depends on the file utility version and a particular distro. Thanks. Previous Comments: ------------------------------------------------------------------------ [2017-10-15 08:50:12] d dot naumenko dot a at gmail dot com Description: ------------ Before PHP 7.2.0 alpha1, function finfo_ function called on XML input returned mime-type application/xml. Since PHP7.2 alpha1 it returns text/xml. When I put the same XML document as in test script bellow to the file and call linux program file on it, I see expected result: $> file --mime-type test.xml test.xml: application/xml Test script: --------------- https://3v4l.org/QDKAp Expected result: ---------------- application/xml Actual result: -------------- text/xml ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75380&edit=1

« previous php.bugs (#212331) next »