Edit report at https://bugs.php.net/bug.php?id=64793&edit=1

 ID:                 64793
 Updated by:         a...@php.net
 Reported by:        weierophin...@php.net
 Summary:            finfo_open raises warning with env magic file
-Status:             Open
+Status:             Not a bug
 Type:               Bug
 Package:            Filesystem function related
 Operating System:   Ubuntu 13.04
 PHP Version:        5.4.14
 Block user comment: N
 Private report:     N

 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

It's expected that the magic file format change across the libmagic versions. 
This 
way you may experience some difference even within the same version, libmagic 
was 
upgraded for 5.4.1 and now again in 5.4.15. The recommended way is to use the 
compiled in magic, passing a magic file from outside you have to care about the 
version compatibility. The same were obviously the experience if you use the 
file 
commando with different magic file versions.


Previous Comments:
------------------------------------------------------------------------
[2013-05-08 18:25:28] weierophin...@php.net

Description:
------------
Using either the system magic file (/usr/share/file/magic.mgc) or the one 
shipped 
with PHP (http://lxr.php.net/xref/PHP_5_5/ext/fileinfo/tests/magic?
r=12cf930a403d0bbee0c40a5e93554cafd6b0895e), and ensuring that my MAGIC env 
points to the file, any call to finfo_open() that does not specify a MIME file 
raises a warning: "offset `' invalid".

This occurs in 5.3.3 and 5.4.14; I cannot reproduce it in 5.3.21. I've tried a 
variety of magic files, and not yet found one that works reliably across 
versions.

Test script:
---------------
$finfo = finfo_open(FILEINFO_MIME_TYPE);

Expected result:
----------------
(no error)

Actual result:
--------------
finfo_open(): Warning: offset `' invalid


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64793&edit=1

Reply via email to