ID:               48885
 Updated by:       scott...@php.net
 Reported By:      majkl578 at gmail dot com
 Status:           To be documented
 Bug Type:         Filesystem function related
 Operating System: Linux Debian
 PHP Version:      5.3.0
 New Comment:

As Pierre has said already this is the way libmagic works and it
matches the RFC for mime type.

The charset on non text documents is also valid, even if it just says
binary.

So there isn't a BC break here unless you were using the mime type for
something else.


Previous Comments:
------------------------------------------------------------------------

[2009-07-12 13:33:48] paj...@php.net

The fileinfo extension has been bundled in PHP (5.3 and later). The
development takes place only in PHP, not anymore in PECL.

Old releases may have issues or may not be compliant with the RFC. Like
it or not, that's a fact.

For the binary data, the charset will obviously be set to binary:

image/gif; charset=binary

It is a documentation, not a bug neither a BC break.



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

[2009-07-12 12:32:34] majkl578 at gmail dot com

Look:
I tested the code mentioned in bug report on php 5.2.10, i used a JPEG
image:
On php 5.3.0 returns 'image/jpeg; charset=binary'
On php 5.2.10 returns 'image/jpeg' only.
So, my question is: is it a bug or a feature in 5.3?

If it's a feature:
1. it is NOT backward compatible.
2. it does not have any meaning for files like images etc, only for
text files.

So?

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

[2009-07-11 22:45:11] paj...@php.net

pls update this example

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

[2009-07-11 21:15:18] majkl578 at gmail dot com

ok sorry for this.

but if it is correct, informations here:
http://php.net/manual/en/function.finfo-file.php are misleading (see
Example #1), because there is not mentioned anything about this, just
about mime type.

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

[2009-07-11 20:44:07] scott...@php.net

This is correct, rfc2045 requires the character set to be there for
mime type.

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

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/48885

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

Reply via email to