PHP 5.2.6
file-4.17-15.el5_3.1
Fileinfo installed through PECL

Checking certain MSWord files, I'm getting back (sans quotes) "application/msword application/msword". Someone reported (in the manual comments) this same thing back in 2007:
http://ca2.php.net/manual/en/ref.fileinfo.php#79063

Can anyone shed any light on how/why this is happening? Specifically, is this a bug in Fileinfo, file (the app), the Word doc, or the magic file itself? I'd love to investigate this further but am having some trouble searching online. Narrowing it down to a specific target would be most helpful. I don't see anything about it at bugs.php.net and I'd rather try to figure out if the problem is PHP-related before filing a bug.

For now, I'm doing the following:

$fi = new finfo(FILEINFO_MIME, FINFO_PATH);
$type = $fi->file($file['tmp_name']);

$split = explode(' ', $type);
$type = $split[0];

Pretty hackish. If anyone has a better solution in the meantime, I'd be most appreciative.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to