php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54016 finfo_file: Cannot determine filetype in archives
Submitted: 2011-02-14 16:20 UTC Modified: 2011-03-30 12:39 UTC
From: bjori@php.net Assigned: bjori
Status: Closed Package: Filesystem function related
PHP Version: 5.3.5 OS: Linux
Private report: No CVE-ID:
 [2011-02-14 16:20 UTC] bjori@php.net
Description:
------------
finfo_file() does not support stream wrappers, such as zip://, even though it has 
stream context option :(

Test script:
---------------
<?php
$fp = finfo_open(FILEINFO_MIME_TYPE);
$png = "zip://" . __DIR__ . "/resources/dir.zip#dir/test.png"

var_dump(finfo_file($fp, $png));


Expected result:
----------------
string(9) "image/png"


Actual result:
--------------
PHP Warning:  finfo_file(): File or path not found 
'zip:///home/bjori/Work/OSS/svn-php/php/php-
src/branches/PHP_5_3/ext/fileinfo/tests/resources/dir.zip#dir/test.png' in 
/home/bjori/Work/OSS/svn-php/php/php-src/branches/PHP_5_3/t.php on line 5


Patches

finfo.patch (last revision 2011-02-14 15:21 UTC) by bjori@php.net)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-02-14 16:21 UTC] bjori@php.net
The following patch has been added/updated:

Patch Name: finfo.patch
Revision:   1297696874
URL:        http://bugs.php.net/patch-display.php?bug=54016&patch=finfo.patch&revision=1297696874
 [2011-02-14 16:21 UTC] bjori@php.net
-Assigned To: +Assigned To: bjori
 [2011-02-14 16:32 UTC] bjori@php.net
Automatic comment from SVN on behalf of bjori
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=308327
Log: Bug#54016 (finfo_file() Cannot determine filetype in archives)
 [2011-02-14 16:34 UTC] bjori@php.net
Automatic comment from SVN on behalf of bjori
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=308328
Log: bfn for #54016
 [2011-03-30 12:39 UTC] bjori@php.net
-Status: Assigned +Status: Closed
 [2011-03-30 12:39 UTC] bjori@php.net
Forgot to close this report.. already fixed in the 5.3.6
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 05:03:19 2014 UTC