Bug #53452 [NEW]: fileinfo magic file path bug
| From: | gep at osiacat dot ru | Date: | Thu, 02 Dec 2010 16:42:12 +0000 |
| Subject: | Bug #53452 [NEW]: fileinfo magic file path bug | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-156695@lists.php.net to get a copy of this message | ||
From:
Operating system: Cent OS
PHP version: 5.3.3
Package: *General Issues
Bug Type: Bug
Bug description:fileinfo magic file path bug
Description:
------------
This bug was reproduced only in PHP 5.3.3 On PHP 5.2.6 works fine.
If you pass a path to magic file situated in Cent OS in
"/usr/share/file/magic"
to finfo_open, then PHP cannot parse magic file.
Though finfo_open(FILEINFO_MIME_TYPE) without second parameter as magic
file path
works fine. (magic file path is taken from system environment)
Test script:
---------------
$finfo = finfo_open(FILEINFO_MIME_TYPE, '/usr/share/file/magic');
echo finfo_file($finfo, 'www/images/message-container/info_icon.png');
Expected result:
----------------
image/png
Actual result:
--------------
PHP Notice: finfo_open(): Warning: description `8-bit ISDN mu-law
compressed
(CCITT G.721 ADPCM voice data enco' truncated in
/home/blackjack/www/test.php on
line 1
PHP Notice: finfo_open(): Warning: description `8-bit ISDN mu-law
compressed
(CCITT G.721 ADPCM voice data enco' truncated in
/home/blackjack/www/test.php on
line 1
PHP Notice: finfo_open(): Warning: <= not supported in
/home/blackjack/www/test.php on line 1
PHP Notice: finfo_open(): Warning: <= not supported in
/home/blackjack/www/test.php on line 1
PHP Notice: finfo_open(): Warning: <= not supported in
/home/blackjack/www/test.php on line 1
PHP Notice: finfo_open(): Warning: >= not supported in
/home/blackjack/www/test.php on line 1
PHP Warning: finfo_open(): Failed to load magic database at
'/usr/share/file/magic'. in /home/blackjack/www/test.php on line 1
PHP Warning: finfo_file() expects parameter 1 to be resource, boolean
given in
/home/blackjack/www/test.php on line 1
--
Edit bug report at http://bugs.php.net/bug.php?id=53452&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53452&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53452&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53452&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=53452&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53452&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=53452&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=53452&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=53452&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=53452&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=53452&r=support
Expected behavior: http://bugs.php.net/fix.php?id=53452&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=53452&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=53452&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=53452&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53452&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=53452&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=53452&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=53452&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=53452&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=53452&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=53452&r=mysqlcfg