Bug #57547 [Opn->Nab]: Settings options on file doesn't give same result as constructor options

From: Date: Thu, 24 Nov 2016 23:51:31 +0000
Subject: Bug #57547 [Opn->Nab]: Settings options on file doesn't give same result as constructor options
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-205623@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=57547&edit=1 ID: 57547 Updated by: ab@php.net Reported by: jonas at websystem dot se Summary: Settings options on file doesn't give same result as constructor options -Status: Open +Status: Not a bug Type: Bug -Package: Fileinfo +Package: *General Issues Operating System: Gentoo Linux PHP Version: 5.1.6 Block user comment: N Private report: N New Comment: Not reproducible with the currently supported PHP versions. Test added. Thanks. Previous Comments: ------------------------------------------------------------------------ [2007-05-06 22:36:29] jm dot barbier at solidev dot org Two problems here, one reason : the magic file is loaded on finfo creation, so if you give FILEINFO_MIME, il will load the magic.mime file, and if you give anything else, il will load the magic.mgc file (or something like that)... that is not really a bug, just a documentation problem. For me the solution was copying all magic files from linux "file" command to /etc/ : ln -s /usr/share/file/magic* /etc/ ------------------------------------------------------------------------ [2007-05-06 22:15:57] jm dot barbier at solidev dot org i can confirm that using Apache/2.2.3 (Debian) DAV/2 PHP/5.2.0-8+etch3 and this module, i'm not able to get any mimetype, even by putting FILEINFO_MIME in the constructor, but only textual description... ------------------------------------------------------------------------ [2007-04-13 11:37:04] jstormes at yahoo dot com finfo->buffer() appears to have the same bug. ------------------------------------------------------------------------ [2007-02-25 14:11:29] jonas at websystem dot se Description: ------------ Hi.. When using the FILEINFO_MIME in ->file() I get different result then using it in the constructor. See example Reproduce code: --------------- $finfo = new finfo(FILEINFO_MIME); echo $finfo->file($filename); $finfo2 = new finfo(); echo $finfo2->file($filename, FILEINFO_MIME); Expected result: ---------------- With: $filename = '..' application/x-not-regular-file application/x-not-regular-file with: $filename = 'my .avi movie' video/x-msvideo video/x-msvideo Actual result: -------------- With: $filename = '..' application/x-not-regular-file application/x-not-regular-file with: $filename = 'my .avi movie' video/x-msvideo RIFF (little-endian) data, AVI, 320 x 240, ~15 fps, video: Motion JPEG, audio: uncompressed PCM (mono, 11024 Hz) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=57547&edit=1

« previous php.bugs (#205623) next »