diff options
author | Anatol Belski <ab@php.net> | 2014-08-30 04:05:42 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-08-30 04:05:42 +0200 |
commit | f4ebeead5d7c81125ebcff30430ae1fa16aa0d73 (patch) | |
tree | ae48847e7b3725ab8021e8c25b1957989f693357 | |
parent | ca042bb18cad305266bcc10086115f2d24000342 (diff) | |
parent | c301467f9ba07384386fa0f61c0c63cb4da037d0 (diff) | |
download | php-git-f4ebeead5d7c81125ebcff30430ae1fa16aa0d73.tar.gz |
Merge branch 'PHP-5.6'
* PHP-5.6:
Fixed bug #67731 finfo::file() returns invalid mime type for binary files
-rw-r--r-- | ext/fileinfo/libmagic/funcs.c | 9 | ||||
-rw-r--r-- | ext/fileinfo/tests/finfo_buffer_basic.phpt | 2 | ||||
-rw-r--r-- | ext/fileinfo/tests/finfo_buffer_variation1.phpt | 2 |
3 files changed, 6 insertions, 7 deletions
diff --git a/ext/fileinfo/libmagic/funcs.c b/ext/fileinfo/libmagic/funcs.c index 4dd3d1c51f..c7d9a7e4f1 100644 --- a/ext/fileinfo/libmagic/funcs.c +++ b/ext/fileinfo/libmagic/funcs.c @@ -27,7 +27,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: funcs.c,v 1.67 2014/02/12 23:20:53 christos Exp $") +FILE_RCSID("@(#)$File: funcs.c,v 1.68 2014/02/18 11:09:31 kim Exp $") #endif /* lint */ #include "magic.h" @@ -173,8 +173,7 @@ file_buffer(struct magic_set *ms, php_stream *stream, const char *inname, const const char *code_mime = "binary"; const char *type = "application/octet-stream"; const char *def = "data"; - - + const char *ftype = NULL; if (nb == 0) { def = "empty"; @@ -187,7 +186,7 @@ file_buffer(struct magic_set *ms, php_stream *stream, const char *inname, const if ((ms->flags & MAGIC_NO_CHECK_ENCODING) == 0) { looks_text = file_encoding(ms, ubuf, nb, &u8buf, &ulen, - &code, &code_mime, &type); + &code, &code_mime, &ftype); } #ifdef __EMX__ @@ -272,7 +271,7 @@ file_buffer(struct magic_set *ms, php_stream *stream, const char *inname, const if ((ms->flags & MAGIC_NO_CHECK_ENCODING) == 0) { if (looks_text == 0) if ((m = file_ascmagic_with_encoding( ms, ubuf, - nb, u8buf, ulen, code, type, looks_text)) + nb, u8buf, ulen, code, ftype, looks_text)) != 0) { if ((ms->flags & MAGIC_DEBUG) != 0) (void)fprintf(stderr, diff --git a/ext/fileinfo/tests/finfo_buffer_basic.phpt b/ext/fileinfo/tests/finfo_buffer_basic.phpt index d8dcfab7a0..0c3c641388 100644 --- a/ext/fileinfo/tests/finfo_buffer_basic.phpt +++ b/ext/fileinfo/tests/finfo_buffer_basic.phpt @@ -48,7 +48,7 @@ string(15) "MIFF image data" string(25) "RIFF (little-endian) data" string(28) "text/plain; charset=us-ascii" string(26) "text/plain; charset=ebcdic" -string(22) "binary; charset=binary" +string(40) "application/octet-stream; charset=binary" string(28) "text/plain; charset=us-ascii" string(28) "text/plain; charset=us-ascii" string(25) "text/plain; charset=utf-8" diff --git a/ext/fileinfo/tests/finfo_buffer_variation1.phpt b/ext/fileinfo/tests/finfo_buffer_variation1.phpt index d9c9be03e3..4fdd2be272 100644 --- a/ext/fileinfo/tests/finfo_buffer_variation1.phpt +++ b/ext/fileinfo/tests/finfo_buffer_variation1.phpt @@ -47,7 +47,7 @@ string(15) "MIFF image data" string(25) "RIFF (little-endian) data" string(28) "text/plain; charset=us-ascii" string(26) "text/plain; charset=ebcdic" -string(22) "binary; charset=binary" +string(40) "application/octet-stream; charset=binary" string(28) "text/plain; charset=us-ascii" string(28) "text/plain; charset=us-ascii" string(25) "text/plain; charset=utf-8" |