php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77299 mime_content_type always returns default value
Submitted: 2018-12-14 17:30 UTC Modified: 2018-12-23 04:22 UTC
From: myshelter at gmail dot com Assigned:
Status: No Feedback Package: Filesystem function related
PHP Version: 7.3.0 OS: Debian 9 (Stretch)
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: myshelter at gmail dot com
New email:
PHP Version: OS:

 

 [2018-12-14 17:30 UTC] myshelter at gmail dot com
Description:
------------
I decided to try PHP 7.3 today, and some things broke because both mime_content_type and finfo_file (with FILEINFO_MIME) were returning application/octet-stream when they shouldn't.

In the same system, with no changes,

file -i /path/to/the/same/file 

returned the correct MIME information for the file.

Downgrading to PHP 7.2.13 in the same system, with no other changes, same php.ini file parameters, fixed the problem. /etc/magic.mime has been empty throughout the whole test.

Test script:
---------------
<?php
echo mime_content_type("/full/path/to/examplevideo.mkv");


Expected result:
----------------
video/x-matroska; charset=binary

Actual result:
--------------
application/octet-stream

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-12-15 20:46 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2018-12-15 20:46 UTC] ab@php.net
Thanks for the report. Please provide a file reproducing the issue. Please do not share any copyrighted materials.

Thanks.
 [2018-12-23 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC