Permalink
Browse files

merge with fix bugs 61565 and 61566 commits

  • Loading branch information...
1 parent 50c91a9 commit 0f8c86d75913bafc60a821b94d1fe487a5ba2294 @NewEraCracker committed Apr 2, 2012
Showing with 253 additions and 92 deletions.
  1. +13 −2 fileinfo.c
  2. +185 −67 libmagic.patch
  3. +2 −2 libmagic/cdf.c
  4. +3 −3 libmagic/compress.c
  5. +8 −0 libmagic/file.h
  6. +15 −15 libmagic/readelf.c
  7. +19 −1 tests/finfo_open_001.phpt
  8. +8 −2 tests/finfo_open_error.phpt
View
@@ -519,11 +519,22 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
wrap = php_stream_locate_url_wrapper(buffer, &tmp2, 0 TSRMLS_CC);
if (wrap) {
+ php_stream *stream;
php_stream_context *context = php_stream_context_from_zval(zcontext, 0);
+
+#ifdef PHP_WIN32
+ if (php_stream_stat_path_ex(buffer, 0, &ssb, context) == SUCCESS) {
+ if (ssb.sb.st_mode & S_IFDIR) {
+ ret_val = mime_directory;
+ goto common;
+ }
+ }
+#endif
+
#if PHP_API_VERSION < 20100412
- php_stream *stream = php_stream_open_wrapper_ex(buffer, "rb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context);
+ stream = php_stream_open_wrapper_ex(buffer, "rb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context);
#else
- php_stream *stream = php_stream_open_wrapper_ex(buffer, "rb", REPORT_ERRORS, NULL, context);
+ stream = php_stream_open_wrapper_ex(buffer, "rb", REPORT_ERRORS, NULL, context);
#endif
if (!stream) {
Oops, something went wrong.

0 comments on commit 0f8c86d

Please sign in to comment.