#33028 [Bgs]: mime_content_type returns inaccurate Office content types
| From: | matt at kanchi dot org | Date: | Sun, 15 May 2005 01:17:37 +0000 |
| Subject: | #33028 [Bgs]: mime_content_type returns inaccurate Office content types | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-79019@lists.php.net to get a copy of this message | ||
ID: 33028
User updated by: matt at kanchi dot org
Reported By: matt at kanchi dot org
Status: Bogus
Bug Type: Filesystem function related
Operating System: OS X
PHP Version: 4.3.10
New Comment:
Well, I upgraded file to 4.13 (the latest version), and the MIME magic
file may be more complicated but it returns the same thing. Since PHP
relies on this file, wouldn't it make sense to check the extension
against what the MIME magic file returns to determine if it's correct?
I would think a warning would at least be warranted in the documentation
until it's resolved. Who knows, maybe I'm the only one who's having
this problem.
Anyway, I guess I'll just manually handle Office extensions or
something.
Previous Comments:
------------------------------------------------------------------------
[2005-05-14 11:02:42] tony2001@php.net
So, the bug is not in PHP, but in your mime.magic file.
No PHP bug -> bogus.
------------------------------------------------------------------------
[2005-05-14 00:55:38] matt at kanchi dot org
In case you meant "file -i /path/to/file.ppt", that returns the same as
mime_content_type does (in my case) for those files. -k returns only
one result.
------------------------------------------------------------------------
[2005-05-14 00:50:38] matt at kanchi dot org
Gotcha. It returns:
(filename): Microsoft Office Document
------------------------------------------------------------------------
[2005-05-13 23:33:09] tony2001@php.net
No, I meant running this command in console.
------------------------------------------------------------------------
[2005-05-13 22:37:18] matt at kanchi dot org
Do you mean mime_content_type("file /path/to/file")? If so, that
returns the error, "mime_magic: invalid mode 0156130."
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/33028
--
Edit this bug report at http://bugs.php.net/?id=33028&edit=1