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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2020 The PHP Group
All rights reserved.
Last updated: Mon Feb 24 06:01:26 2020 UTC